Hi.
We have created a MDR job that calls the delete action defined on custom BO.
There is Query object created on Custom BO automatically.
When the Job runs and executes the Action : Delete should get triggered but none of the data from custom BO where Backlog date is more than 31 days old gets deleted. Is there something wrong with code.
import ABSL;
/** Querying the OrderBacklog BO **/
var query = ZBO_OrderBacklog.QueryByElements;
/* Creating selection parameters **/
var selectionParams = query.CreateSelectionParams();
/** Fetching current date **/
var currentDate = Context.GetCurrentSystemDate();
/** Setting the threshold date as 31 days before the current date **/
var thresholdDate = currentDate.SubtractDuration(Duration.ParseFromString("P31D"));
/** Querying the BO on date less than the threshold date **/
selectionParams.Add(query.OrderBacklogDate, "I", "LT", thresholdDate);
/** Executing the query **/
var resultData = query.Execute(selectionParams);
/** Deleting the records **/
foreach (var BO in resultData)
{
BO.Delete();
}