Sage CRM Opportunity Custom Content - Get current workflow ID

I'm preparing to migrate our opportunity workflow to a new one, and need to include a bit of javascript in the screens custom content to hide/show some fields based on the workflow the opportunity is following. 

I have no issue with the hide/show part, but I'm not sure how/if I can get the ID of the workflow it is following. 

Can anyone advise if this is possible?

Parents Reply
  • 0 in reply to Michele Gaw

    Thanks Michele - While very interesting unfortunately this won't help me in this situation. This only gives the current rule ID rather than the workflow ID, and it is also quite inconsistent when it includes that in the URL. For example if opening the opportunity from the recent menu it doesn't include any of the 'key' values in the URL. 

Children
  • 0 in reply to joshSWR

    Josh:  I will take a look at my notes and see if I can offer more.  Also, if you have the current rule id, you can use that to find your way back to the workflow id.

    I will follow up with what I find.

  • 0 in reply to Michele Gaw

    When you initially start a workflow, there are fields that you can be setup to autopopulate the field.  Like oppo_type.  Since I don't know the different types, I will refer to New or Old.

    When the initial oppo screen is displayed the oppo type field will contain either New or Old.  You can then use this type to display a field or not using the Values() Colletion.  

    At one time, there was an article in the community titled "Display certain fields depending on workflow".  

    However, I can no longer find the article.  Hope this helps!

  • 0 in reply to Michele Gaw

    The Workflow ID is basically (in SQL) done as Opportunity (e.g. Oppo_Workflowid) > WorkflowInstance (wkin_instanceid) From WorkflowInstance table you're looking for Wkin_workflowid for the Workflow ID number. 

    Though personally it would be better to have the 'New Opportunity' buttons for both workflows flag the Opportunity in some way if it is A or B then in future you just need to query the opportunity record itself to know which workflow it is following.