Note: Thisrequires SuiteScript knowledge.
Beforeyou can use nlapiAddDays on a date field, the value of the date field must beconverted into a date object using nlapiStringToDate. Then usenlapiDateToString to convert the date back to a string in the date format ofthe current user. Otherwise, the value being set will be a date data type (nota string), so NaN (not a number) will be set on the date field.
Seesample code below:
EstCloseDate = nlapiStringToDate(nlapiGetFieldValue('expectedclosedate'));
NewDueDate = nlapiDateToString(nlapiAddDays(EstCloseDate,60));
nlapiSetFieldValue( 'duedate', NewDueDate);
No comments:
Post a Comment