cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member226
Employee
Employee
0 Kudos

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

Former Member
0 Kudos

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

Answers (1)

Answers (1)

former_member574801
Participant
0 Kudos

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