Forum Discussion

NidhiMangtani's avatar
NidhiMangtani
Contributor III
2 years ago

Updating WFScenario through a Business Rule

Hi All,

Is there a possibility to update WFScenario for all users of the application from back end through a Business Rule?

When moving the app from one quarter to another for Financial Regional planning, some of the not so tech savvy Sales users are forgetting to change their WFScenario and triggering the calculations which are erroring out due to older scenarios being locked. We would like to have Admin update WFScenario for all the users of the application as a maintenance task. 

Please let me know if the below would work for all the users.

Or any other leads would also be appreciated.

 

  • BRApi.Workflow.General.SetSelectedWorkflowView(si, profileName, scenarioName, timeName)

    followed by refreshing the application through extender rule worked fine.

    'Can be called from a dashboard extender business rule:
    Dim selectionResult As New XFSelectionChangedTaskResult()
    selectionResult.WorkflowWasChangedbyBusinessRule = True
    Return selectionResult

     

    No further assistance needed on this thread.

    • NidhiMangtani's avatar
      NidhiMangtani
      Contributor III

      Hello,

      I think we celebrated too soon.

      BRApi.Workflow.General.SetSelectedWorkflowView(si, profileName, scenarioName, timeName)

      This statement is setting WorkflowView only for current user, not all users. Has anyone forced Workflow settings refresh for all the users?

       

       

  • SStalker's avatar
    SStalker
    New Contributor III

    Each user's default workflow setting is stored in the WorkflowView.xml file in the File Explorer (see screen shot).  Unfortunately, there is no built-in call to update this for each user.  You would need to build a rule to loop over the XML file for all users and modify each. You would also need to be careful not to assign a scenario that a user does not have access to view.

    Something similar to this is done in the AST solution where the default home page is updated in the UserAppSettings.xml file in the same folder.