reduce the demand states based on estimated cost or priority

Learner-in-Prog
Tera Expert

Hi All -

 

Just wanted to check the feasibility on below ask

 

we have 6 state when we create the demand from Idea or demand application (Draft, Submitted, Screening, Qualified, Approved and Completed). We want to skip the 2 states (Draft, Submitted, Approved and Completed) when the estimated cost is less and/or Priority is Low.

 

Can someone share the steps or guide how to achieve it.

 

Thanks in Advance.

 

 

3 REPLIES 3

Dnyaneshwaree
Mega Sage

Hello @Learner-in-Prog ,

Please check and open the UI action of the "Screening" and "Qualified" state and add condition(it runs when) in condition/script that, "estimated cost is  not equal to zero or lesser amount and/or Priority is high".

Please accept my solution if it works for you and thumps up to mark it as helpful.

Thank you!!


Dear @Dnyaneshwaree -

 

I was able to hide / disable them from Process flow and UI Action. Even I have created the business rule there might be i am not able to write the script or some issues there.

SasankaV
Giga Guru

 

Hey @Learner-in-Prog, I worked on a similar use case in my experience at Work4flow. I followed the steps below to implement it:

  • Determine the threshold for estimated cost below which states will be skipped.
  • Define the criteria for low priority demands that should skip states.
  • Navigate to System Definition > Business Rules or Script Includes.
  • Develop a script to evaluate the conditions and skip states accordingly.

Example script:

 

(function() {
    var DemandStateSkipper = Class.create();

    DemandStateSkipper.prototype = {
        initialize: function() {},

        skipStates: function(demand) {
            if (demand.estimated_cost < your_threshold && demand.priority == 'Low') {
                // Skip Draft and Submitted states
                demand.state = 'Screening';
            }
            // Add more conditions and state skips as needed
        },

        type: 'DemandStateSkipper'
    };

    return new DemandStateSkipper();
})();

 

 

  • Navigate to the demand workflow configuration.
  • Modify the workflow transitions to include the script logic for skipping states.

Give it a try, and let me know if it doesn't work. I'd be happy to assist.