Forum Discussion

sfilho's avatar
sfilho
New Contributor III
3 years ago

Getting the Workflow Profile Text1 attribute value using BRApi

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.

 

  • 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.

     

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    If you're in a XFBR, you should be able to use args.SubstVarSourceInfo.WFText1 .

     

    • sfilho's avatar
      sfilho
      New Contributor III

      Unfortunately the Text1 field I need to get the information from is not at the ".Forms" level.

      Thank you for the help.

    • MarkHoughton's avatar
      MarkHoughton
      Contributor

      Hi,

      A few months ago I used the recommended solution of 

      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)

      And it gave me the correct value I was expecting, however, since moving to 7.3.1.14520 my cubeview BR will not retrieve the Text1 value from the WF.profile. Has the "18000" id value changed in this version ?

      If I hard code my WF.Text1 value into my BR I can still pull my UD4.Textx value which alters by time and scenario, so unusual that the WF profile Text1 is not pulling through. I have tried recompiling as well as amending the variable names to see if that will kick it back to life.

      Any thoughts as to why it will not work ?

      Regards

      Mark

       

      • JackLacava's avatar
        JackLacava
        Honored Contributor

        Have a look in the backend database tables, they should tell you if that ID has changed.

  • db_pdx's avatar
    db_pdx
    Valued Contributor

    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

    • sfilho's avatar
      sfilho
      New Contributor III

      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