11-03-2022
11:12 AM
- last edited
a month ago
by
JackLacava
I am trying to get the Text1 field value using a Business Rule and put this value in a cube view that is being used as Form.
Does anyone have done this before? Is it possible to get the Text1 value from the Workflow Profile using BRApi?
Thanks for the help.
Solved! Go to Solution.
11-03-2022 04:40 PM
Yes it is ugly. I could not get this piece working properly:
GetAttributeValue(BRApi.Finance.Scenario.GetScenarioType(si, args.SubstVarSourceInfo.WFScenario.DimId).Id
I replaced with:
Dim wfClusterPK As WorkflowUnitClusterPk = si.WorkflowClusterPk
Dim wfScenarioTypeID As Integer = BRApi.Workflow.General.GetScenarioTypeId(si, wfClusterPK)
Dim sVarStep2 As String = BRApi.Workflow.Metadata.GetParent(si, args.SubstVarSourceInfo.WorkflowUnitInfo.ProfileName).GetAttributeValue(wfScenarioTypeID, 18000)
It brought the correctly value.
11-03-2022 11:56 AM - edited 11-03-2022 11:56 AM
Hi sfilho:
Are you only using the Text1 as a POV selection in the cube view? If so, you can reference it directly in the Cube View as |WFText1|, no BR required. Let us know if that satisfies your requirements.
Cheers -DB
11-03-2022 01:31 PM
Helllo There, The Text1 field that I am using is at the level highlighted in red. Is not at the ".Forms" level.
Thank you for the help
11-03-2022 01:42 PM - edited 11-03-2022 01:43 PM
Add it to the Forms level?
11-03-2022 01:53 PM
😊That's what I said. Then I heard "Well than we will have to remember to update that field in every .Forms profile we create" then I said "Yes you might want to remember that". Anyways this is stored somewhere in the database in a table. I would think that a method to get that information should exist right?
11-03-2022 02:32 PM
At least for our implementation we don't have too many distinct Form Templates so it is really only an initial setup thing in my opinion. Also, a reminder: you should be adding more Forms to the Template. Not creating new Templates for singular Forms. This way any new form they add to the Form Template will already benefit from the metadata you are adding to that step.
Back to your original question, yes, we can get at it; it is just ugly. Assuming usage in an XFBR String Business Rule
myString = BRApi.Workflow.Metadata.GetParent(si, args.SubstVarSourceInfo.WorkflowUnitInfo.ProfileName).GetAttributeValue(BRApi.Finance.Scenario.GetScenarioType(si, args.SubstVarSourceInfo.WFScenario.DimId).Id, 18000)
Where the Attribute Index is:
Text1 = 18000, Text2 = 20000, Text3 = 22000, Text4 = 24000
11-03-2022 04:40 PM
Yes it is ugly. I could not get this piece working properly:
GetAttributeValue(BRApi.Finance.Scenario.GetScenarioType(si, args.SubstVarSourceInfo.WFScenario.DimId).Id
I replaced with:
Dim wfClusterPK As WorkflowUnitClusterPk = si.WorkflowClusterPk
Dim wfScenarioTypeID As Integer = BRApi.Workflow.General.GetScenarioTypeId(si, wfClusterPK)
Dim sVarStep2 As String = BRApi.Workflow.Metadata.GetParent(si, args.SubstVarSourceInfo.WorkflowUnitInfo.ProfileName).GetAttributeValue(wfScenarioTypeID, 18000)
It brought the correctly value.
11-04-2022 09:16 AM
At the of the day I think this works. Thank you for the help!!
11-03-2022 12:00 PM
If you're in a XFBR, you should be able to use args.SubstVarSourceInfo.WFText1 .
11-03-2022 01:32 PM
Unfortunately the Text1 field I need to get the information from is not at the ".Forms" level.
Thank you for the help.