Skip to Content
0

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

Jan 19 at 04:42 PM

89

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Saurabh Kabra
Jan 19 at 05:11 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Saurabh for the advice.

I think it's a pity not to have this possibility in the workflow rules

Kind Regards,

Jérémie Waltman

0