Parser rule issue

sruthy
New Contributor

 

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 .

 

1 ACCEPTED SOLUTION

JackLacava
Community Manager
Community Manager

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(",")

View solution in original post

2 REPLIES 2

JackLacava
Community Manager
Community Manager

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(",")

sruthy
New Contributor

Thank you @JackLacava that makes sense.

 

Regards,

Sruthy