Here is place that will be updated with Data processing scripts and tips.
IF statement
The if statement can be used in data processing rules.
var now : DateTime = DateTime.Now;
if (Test_start<=now){
Mainstatus = '4';
}
Add days to a date and out in format DD-MONTH-YEAR
This code will add X days to a date and output as DD-MONTH-YEAR format
Var1 and Var2 need to be defined on the righthand side of the rule
var originalDate = GetValue('VAR1');
var newDT = originalDate.AddDays(133);
Var2 = newDT;
var monthnum= newDT.Month;
var monthTxt = ['January', 'February', 'March', 'April', 'May','June', 'July', 'August', 'September','October','November','December'];
var monthName = monthTxt[monthnum-1];
Var2 = newDT.Day +' '+ monthName+ ' '+ newDT.Year;
Checking if date is greater than another.
var derD: DateTime = DER_DOLC;
var dDate : DateTime = new DateTime(“2019”, “06”, “01”);
if(derD >= dDate)
{
}