Skip to main content
Newcomer
Nov 7, 2022 10:53 AM UTC
Solved

Parser rule issue

 

I have a parser rule that works fine for a Budget type scenario but does not read a WFText1 for a Scenario Type 2 .

I am using the below syntax to read the WFText1 property from a parser rule .This step is an import type step.

sruthy_1-1667817899107.png

It returns the GL list as blank for my scenario type 2 but works fine for my budget type scenario. Both are in different Workflow profiles.

It picks up the correct workflow profile as i checked after logging it but unable to somehow pick up the text 1 value .

 

Employee - Sage
Nov 8, 2022 9:00 AM UTC

You are hardcoding the scenario type ID - the first parameter to GetAttributeValue, so maybe your problem is there.

Also make sure you're actually on the right workflow profile, i.e. "Houston.Import" is different from "Houston" and will not inherit Text values.

This code works:

Dim myScenarioType As ScenarioType = BRApi.Finance.Scenario.GetScenarioType(si, si.WorkflowClusterPk.ScenarioKey)
Dim myWorkflow As WorkflowProfileInfo = brapi.Workflow.Metadata.GetProfile(si, si.WorkflowClusterPk)
Dim wfText As String = myWorkflow.GetAttributeValue(myScenarioType.Id, SharedConstants.WorkflowProfileAttributeIndexes.Text1)
Dim wf1 As New NameValueFormatBuilder(wfText)
' the last bit is not very robust...
Dim myValues As String() = wf1.GetValue("GL").Split(",")

2 replies

Employee - Sage
Nov 8, 2022 9:00 AM UTC

You are hardcoding the scenario type ID - the first parameter to GetAttributeValue, so maybe your problem is there.

Also make sure you're actually on the right workflow profile, i.e. "Houston.Import" is different from "Houston" and will not inherit Text values.

This code works:

Dim myScenarioType As ScenarioType = BRApi.Finance.Scenario.GetScenarioType(si, si.WorkflowClusterPk.ScenarioKey)
Dim myWorkflow As WorkflowProfileInfo = brapi.Workflow.Metadata.GetProfile(si, si.WorkflowClusterPk)
Dim wfText As String = myWorkflow.GetAttributeValue(myScenarioType.Id, SharedConstants.WorkflowProfileAttributeIndexes.Text1)
Dim wf1 As New NameValueFormatBuilder(wfText)
' the last bit is not very robust...
Dim myValues As String() = wf1.GetValue("GL").Split(",")
sruthyAuthor
Newcomer
Nov 8, 2022 9:18 AM UTC

Thank you JackLacava that makes sense.

 

Regards,

Sruthy