Skip to Content

Workflow rules - Automatic close of the opportunity if the close date has passed

Hello

we would like to get the possibility to automatically close the opportunity if the close date has passed (overdue). I tried to use the workflow rules, but in "Define Actions" :

- if i use the rule type "Field Update", I don't find the opportunity status field

- if i use the rule type "Action", i don't find the "close opportunity" action

Do you know if it's achievable. Can you please help ?


Thank you

Jérémie Waltman

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jan 19, 2018 at 05:11 PM

    Hi,

    Instead of using Workflow rules to do so please evaluate if you can make use of MDR(Mass Data Run) functionality where using ABSL code you can use first filter all the opportunities and then use action "STOP" to close the opportunities.

    import ABSL;import AP.CRM.Global;
    
    var CurrrentDate = Context.GetCurrentSystemDate();
    
    var query = Opportunity.QueryByElements;
    var p = query.CreateSelectionParams();
    p.Add( query.SalesForecastExpectedProcessingDatePeriod.EndDate,"I","LT",CurrrentDate);
    p.Add( query.Status.LifeCycleStatusCode,"I","EQ","1");
    p.Add( query.Status.LifeCycleStatusCode,"I","EQ","2");
    var res = query.ExecuteFromDB(p);
    
    
    foreach( var Opp in res)
    {	
    	Opp.Name.content = "Stalled Opportunity. Automatically Closed";
    	Opp.Stop();
    }
    

    You can schedule the MDR Monthly or Weekly based on your amount of client data.

    https://blogs.sap.com/2016/05/17/how-to-schedule-a-batch-job-using-mdr-in-c4c/

    Thanks

    Saurabh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 06, 2019 at 05:07 AM

    there is an option called custom status in WF and also you can schedule the conversion based on standard dates available in teh WF

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.