Deprecated GetLiteralParameterValue and SetLiteralParameterValue replacements?
I'm getting the message "'Function GetLiteralParameterValue(si As SessionInfo, isSystemLevel As Boolean, parameterName As String) As String' is obsolete: 'This is a temporary function used by Marketplace Solutions for backwards compatibility with old XF versions. Please change your code to use supported functionality.'." Anyone know what object & method should I be using instead? strSomeString = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si,Nothing,"pm_SomeParameter")Solved9.2KViews3likes19CommentsLiteral parameters and multiple users
Hi all, I'm currently developing a dashboard that will likely be used by multiple users at the same time. Users will be able to set some initial parameters within the dashboard, and click on a button that will trigger a BR that will return some output rows within a table in the database. After the process is complete, the user will be able to see the output rows through the following SQL Table Editor: the parameters that you can see in the "Where Clause" are literal parameters that are set from within the BR when it is triggered by the user (using BRApi.Dashboards.Parameters.SetLiteralParameterValue()), and their value depend on the initial parameters that the user selected in the dashboard. The problem is, I saw in some posts within the forum that literal parameters are "common" to all users, so every time one user will click the button and launch the process, the literal parameters will be changed. This is a problem, because we expect users to use the dashboard simultaneously. Is there a workaround that does not use literal parameters? Or is there a way to make literal parameters "unique" to every user? Thanks in advance!Solved7.8KViews0likes21CommentsEnforce Constraints on Data Table. Failed to enable constraints. One or more rows contain values.
I am trying to return a SQL query in a Data table inside the business rule. But I am Getting the issue:Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. I tried to remove the constraint. Maybe I am doing it incorrectly or it is not possible. Dim sql As New Text.StringBuilder sql.AppendLine("Select COALESCE(S.RegisterID,O.RegisterID, W.RegisterID) RegisterID, ") sql.AppendLine("COALESCE(S.RegisterIDInstance,O.RegisterIDInstance,W.RegisterIDInstance) RegisterIDInstance, ") sql.AppendLine("COALESCE(S.WFProfileName,O.WFProfileName,W.WFProfileName) WFProfileName, ") sql.AppendLine("COALESCE(S.WFScenarioName,O.WFScenarioName,W.WFScenarioName) WFScenarioName, ") '''''''''QUERY Continues as below SQL CODE. Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si) Dim ds As New DataSet ds.Tables.Clear() ds.EnforceConstraints = False Dim dt As DataTable = ds.Tables.Add() ' error comes when executing next line dt = BRApi.Database.ExecuteSql(dbConnApp, sql.ToString, False) Dim Count As Integer = dt.Constraints.Count BRApi.ErrorLog.LogMessage(si, "Count: here2") Return dt End Using The SQL query generates a table in a Data Adapter dashboard component. But the rule fails as the Data table does not enforce constraints through data coming from SQL. The SQL query: Select COALESCE(S.RegisterID,O.RegisterID, W.RegisterID) RegisterID, COALESCE(S.RegisterIDInstance,O.RegisterIDInstance,W.RegisterIDInstance) RegisterIDInstance, COALESCE(S.WFProfileName,O.WFProfileName,W.WFProfileName) WFProfileName, COALESCE(S.WFScenarioName,O.WFScenarioName,W.WFScenarioName) WFScenarioName, COALESCE(S.WFTimeName,O.WFTimeName,W.WFTimeName) WFTimeName, COALESCE(NULLIF(O.JobTitle,''),W.JobTitle) JobTitle, COALESCE(NULLIF(O.LastName,''), W.LastName) LastName, COALESCE(NULLIF(O.FirstName,''), W.FirstName) FirstName, COALESCE(O.Wage,W.Wage) Wage, COALESCE(O.Bonus,W.Bonus) Bonus, COALESCE(O.FTE,W.FTE) FTE, COALESCE(O.GradeLevel,W.GradeLevel) GradeLevel, COALESCE(S.Status,O.Status,W.Status) Status, COALESCE(O.HireDate ,W.HireDate ) HireDate, COALESCE(O.HirePeriod,W.HirePeriod) HirePeriod, COALESCE(O.TermDate,W.TermDate) TermDate, COALESCE(O.TermPeriod,W.TermPeriod) TermPeriod, COALESCE(O.BirthDate,W.BirthDate) BirthDate, DATEDIFF(month, '1/1/2024', IIF(CONVERT(varchar,COALESCE(NULLIF(O.TermDate,'1/1/1900 12:00:00 AM'), W.TermDate),101) = '1/1/1900','1/1/3999',CONVERT(varchar,COALESCE(NULLIF(O.TermDate,'1/1/1900 12:00:00 AM'), W.TermDate),101))) +1 As OutPeriod, COALESCE(S.OutCode,O.OutCode,W.OutCode) OutCode, DATEDIFF(month, '1/1/2024',IIF(CONVERT(varchar,COALESCE(NULLIF(O.DCode1,'1/1/1900 12:00:00 AM'), W.DCode1),101) = '1/1/1900','1/1/3999',CONVERT(varchar,COALESCE(NULLIF(O.DCode1,'1/1/1900 12:00:00 AM'), W.DCode1),101))) +1 As InPeriod, COALESCE(NULLIF(NULLIF(S.Entity,'None'),''),NULLIF(NULLIF(O.Entity,'None'),''),W.Entity) Entity, COALESCE(NULLIF(NULLIF(S.Code1,'None'),''),NULLIF(NULLIF(O.Code1,'None'),''), W.Code1) Code1, COALESCE(NULLIF(O.Code2,'None'), W.Code2) Code2, COALESCE(NULLIF(O.Code3,''), W.Code3) Code3, COALESCE(NULLIF(O.Code4,''), W.Code4) Code4, COALESCE(NULLIF(O.Code5,''), W.Code5) Code5, COALESCE(NULLIF(O.Code6,''), W.Code6) Code6, COALESCE(NULLIF(O.Code7,''), W.Code6) Code7, COALESCE(NULLIF(O.Code6,''), W.Code6) Code8, COALESCE(NULLIF(O.Code6,''), W.Code6) Code9, COALESCE(NULLIF(O.Code6,''), W.Code6) Code10, COALESCE(O.NCode1, W.NCode1) NCode1, COALESCE(O.NCode2, W.NCode2) NCode2, COALESCE(O.NCode3, W.NCode3) NCode3, COALESCE(O.NCode4, W.NCode4) NCode4, COALESCE(O.NCode5, W.NCode5) NCode5, COALESCE(O.NCode6, W.NCode6) NCode6, COALESCE(O.NCode7, W.NCode7) NCode7, COALESCE(O.NCode8, W.NCode8) NCode8, COALESCE(O.DCode1, W.DCode1) DCode1, COALESCE(O.DCode2, W.DCode2) DCode2, COALESCE(O.DCode3, W.DCode3) DCode3, COALESCE(O.DCode4, W.DCode4) DCode4, COALESCE(NULLIF(O.Annot1,''),W.Annot1) Annot1, IIF(COALESCE(S.Status,O.Status,W.Status) = 'Workday','Workday', 'People Register') As Annot2, XFW_PLP_CalcPlanDetail.CalcPlanDetailID As DetailID, XFW_PLP_CalcPlanDetail.FKClassID, XFW_PLP_CalcPlanDetail.Description, XFW_PLP_CalcPlanDetail.WeightOrCount, XFW_PLP_CalcPlanDetail.PeriodDivisor, XFW_PLP_CalcPlanDetail.PeriodFilter, XFW_PLP_CalcPlanDetail.Condition, XFW_PLP_CalcPlanDetail.EntityOverride, XFW_PLP_CalcPlanDetail.FlowOverride, XFW_PLP_CalcPlanDetail.ICOverride, XFW_PLP_CalcPlanDetail.UD1Override, XFW_PLP_CalcPlanDetail.UD2Override, XFW_PLP_CalcPlanDetail.UD3Override, XFW_PLP_CalcPlanDetail.UD4Override, XFW_PLP_CalcPlanDetail.UD5Override, XFW_PLP_CalcPlanDetail.UD6Override, XFW_PLP_CalcPlanDetail.UD7Override, XFW_PLP_CalcPlanDetail.UD8Override, XFW_PLP_CalcPlanDetail.Sequence From (Select * from XFW_PLP_Register where status='Workday' and WFProfileName = 'Workforce UK.01 Employee Register' And WFScenarioName = 'BudV1' And WFTimeName = '2024' ) W FULL OUTER JOIN (Select * from XFW_PLP_Register where Status = 'OneStream' and WFProfileName = 'Workforce UK.01 Employee Register' And WFScenarioName = 'BudV1' And WFTimeName = '2024') O On O.RegisterID = W.RegisterID LEFT OUTER JOIN (Select * from XFW_PLP_Register where Status = 'Split' and WFProfileName = 'Workforce UK.01 Employee Register' And WFScenarioName = 'BudV1' And WFTimeName = '2024') S On S.RegisterID = W.RegisterID CROSS Join XFW_PLP_CalcPlanDetail Where ( XFW_PLP_CalcPlanDetail.FKCalcPlanID = '01_ACTIVE_UK' And XFW_PLP_CalcPlanDetail.FKWFProfileName = 'PlanTemplate' And XFW_PLP_CalcPlanDetail.FKWFScenarioName = 'PlanTemplate' And XFW_PLP_CalcPlanDetail.FKWFTimeName = 'PlanTemplate' ) Order By RegisterID,RegisterIDInstance,XFW_PLP_CalcPlanDetail.CalcPlanDetailID, XFW_PLP_CalcPlanDetail.SequenceSolved6.7KViews0likes16CommentsButton Highlighting Business Rule - "Load Dashboard Server Task (Once)" running twice?
Hello, I have a problem with a couple business rules running at the wrong times from within a dashboard. The background: I have a business rule that changes the formatting of the buttons on a dashboard to show which one was clicked last. The buttons function as "tabs," each linking to a report; the button linking to the currently selected report shows itself as highlighted. To do this, I have the name of the current active button stored in a literal parameter. When a button is clicked to launch a report, a business rule rewrites the value of this literal parameter. (An XFBR String rule then reads this parameter to determine how to format the buttons, and is output to button - formatting - display format). The problem: When I launch the dashboard from OnePlace, the highlighting works correctly, showing a set of buttons with the first button highlighted. When I click another button, the button works correctly by launching a report, but the first button remains highlighted. The literal parameter does not update with the name of the newly clicked button as it should. BUT if I click any other button a second time, the highlighting starts working correctly, and the literal parameter is rewritten by the BR. So what's happening? When I launch the DB from OnePlace, a Load Dashboard Server Task runs (DashboardExtenderFunctionType.LoadDashboard). When I click a button within the dashboard, a Selection Changed Server Task runs (DashboardExtenderFunctionType.ComponentSelectionChanged). It looks like the first time a button is pushed, either the Load DB server task is running a second time or the Selection Changed server task is not running.I don't know why a second push of the button changes its behavior. I don't know how to track the problem any further and would love your thoughts if you've read this far; any ideas? Rewrite literal parameter BR: Namespace OneStream.BusinessRule.DashboardExtender.Button_Format Public Class MainClass Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardExtenderArgs) As Object Try Dim bda = New OneStream.BusinessRule.Finance.BDA_BRFramework.MainClass(si, globals) Select Case args.FunctionType Case Is = DashboardExtenderFunctionType.LoadDashboard If args.FunctionName.XFEqualsIgnoreCase("ActiveButton_Launch") Then 'Implement Load Dashboard logic here. Dim strButtonName As String = args.NameValuePairs("ButtonName") BRApi.Dashboards.Parameters.SetLiteralParameterValue(si, False, "param_active_Btn", strButtonName) Dim loadDashResult As New XFLoadDashboardTaskResult() Return loadDashResult End If Case Is = DashboardExtenderFunctionType.ComponentSelectionChanged If args.FunctionName.XFEqualsIgnoreCase("ActiveButton") Then 'Implement Dashboard Component Selection Changed logic here. Dim strButtonName As String = args.NameValuePairs("ButtonName") BRApi.Dashboards.Parameters.SetLiteralParameterValue(si, False, "param_active_Btn", strButtonName) Dim selectionChangedTaskResult As New XFSelectionChangedTaskResult() Return selectionChangedTaskResult End If End SelectSolved5.5KViews1like10CommentsWhat does ' DataTable already belongs to another DataSet.' error mean an how to fix?
I have a data adapter that calls a BR that calls one of the IC methods (I thinned it down here) but what I run the data adapter I get the error that the datatable already belongs to another dataset. Any help on what that means and how to resolve? Public Shared Function IntercompanyReportBudget(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardDataSetArgs) As DataTable Dim Threshold As Integer = args.NameValuePairs.XFGetValue("Threshold") Dim dtInterCoBud As New DataTable Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si) Dim interCoMethodQuery As String = "{|WFProfile|}{|WFScenario|}{|WFTime|}{}{C#USD}{V#YTD}{}{" & Threshold & "}{}{}{}{}" dtInterCoBud = BRApi.Database.ExecuteMethodCommand(dbConnApp, XFCommandMethodTypeId.ICMatchingForWorkflowUnitMultiPlug, interCoMethodQuery, "ICBud", Nothing).Tables(0) End Using Return dtInterCoBud End FunctionSolved5.4KViews0likes9CommentsWorkspace assemblies - Call functions from another file within the same assembly
Hi I'm trying to find out the correct way to reference a function in another Workspace assemblies file. For example say i have: 1) XFBR business rule assembly file (ParamHelper.Vb) 2)Dashboard Extender business rule assembly file (SolutionHelper.Vb) I want to call a function that is in SolutionHelper.vb from my code that sits in ParamHelper.vb In standard business rules this was easily achieved using Referenced Assemblies in the business rule property and then adding something along the lines of this below: Dim _MYHelper As New OneStream.BusinessRule.DashboardExtender.HPB_SolutionHelper.MainClass Just not sure how the same is achieved using assemblies Thank youSolved5.2KViews0likes11CommentsCombo box multiselect parameter list
I have a dashboard where I created Parameter1 using bound list which is referenced in a combo box. A button then passes the data to the business rule. The issue I am having is that it only recognizes the first selected member and ignores all other selected members.How do you pass a multiselect list from combo box in Dashboard in order to loop through the list?Solved4.9KViews0likes8CommentsAssign a value to a dashboard parameter from BR code
Hi all, I'm currently developing a dashboard for a client and I need to assign a literal value to a dashboard parameter from the BR code. I'll try to explain the issue better: I created the following parameter "test" within a dashboard group: within the BR, I entered the following: In this case, I'm trying to assign the text "SampleText" to the parameter "test". I then created a combo box, I assigned the parameter "test" as a bound parameter, and placed the combo box in the dashboard: My goal is that, once triggered the BR, I will be able to see "SampleText" in the dashboard. Once the BR is triggered, though, no value is assigned to the parameter, and the combo box remains empty. What am I doing wrong?4.5KViews1like7Comments