Forum Discussion

manthangandhi's avatar
manthangandhi
New Contributor III
8 months ago

Assistance Needed: Updating "Profile Active" Property via Extender Rule

 

Dear Team,

I am currently working on updating the "Profile Active" property for a specific scenario type within a workflow profile. I am trying to implement this change using the below code snippet, but am not seeing the desired result:

code snippet:

brapi.Workflow.Metadata.GetProfile(si, "Parent Profile.Profile Name").SetAttributeValue(ScenarioType.Control.Id, 1300, Boolean.TrueString)

Though I am aware that this update can be performed manually by accessing individual workflow profiles or using the grid view, my requirement is to execute this task through an extender rule.

I've identified that the attribute index for "Profile Active" is 1300 and the value to be updated is of an object type. I suspect there may be an issue with the way I'm passing the new value in the code.

I would appreciate any guidance or insight on how to correctly update this property using the extender rule.

Your assistance is greatly appreciated.

Thanks

 

  • FredLucas's avatar
    FredLucas
    Contributor III

    Hi, 

    The SetAttributeValue function only updates the settings temporarily, it does not store them in the database.

    There's an open enhancement request asking for a way to have these updates committed to the database.

    In the meantime, although fairly complex, a workaround solution for it would be to automate the production and load of an xml file containing the attribute values you are looking for.

    Regards,

    Fred

     

    • manthangandhi's avatar
      manthangandhi
      New Contributor III

      Hi Fred,

      Is there any alternate way to perform this usinng database, anyclue on this?

      • Krishna's avatar
        Krishna
        Valued Contributor

        manthangandhi  - You can try with the WFText1 value. This could be workaround vs updating the table directly. My 2 Cents. I am not sure about the complete use case, trying to put some ideas.

        1. Create a Extender BR to populate the text1 Value of the WF profile.

        2. Ignore the WF Profile in your BR based on the Text1 value.

         

  • DanielWillis's avatar
    DanielWillis
    Valued Contributor

    I'm not sure you're passing the right parameter in the first position. What is ScenarioType.Control.Id supposed to be?

    If it is a specific scenario type you know ahead of time then you could use something like ScenarioTypeId.Budget.

    Otherwise one of the methods to obtain the scenariotypeid from current wf/global/wherever, e.g. brapi.Workflow.General.GetScenarioTypeId(...)