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