I have a custom due date field on my sales order. ...
# suiteflow
a
I have a custom due date field on my sales order. The calculation is triggered on when the customer is chosen. Unfortunately this formula doesn's seem to work. nlapiDateToString(nlapiAddDays(new Date(nlapiGetFieldValue('custbody_aim_due_date')),14)) Any suggestions? thanks
a
Are you attempting to do this via a workflow action? Like set field value action?
a
@AI1 yes exactly, the trigger is after field edit in the workflow, but the formula doesn't give the the calculation I'm looking for
a
Usually the formula {custbody_aim_duedate} + 14 works in a workflow
Well usually for adding days to a custom date field. If you try to set a native date field this way it gives you a format error
a
@AI1 The whole logic for the dates is following: Issue Date + 14 = Due Date I applied this SQL formula: {custbody_issue_date} + 14 issue date was e.g. 14.01.2022 result due date was 14.01.2022, too. Didn't apply the + 14
a
Is the issue date always today? Also if you try making the trigger after record submit does it calculate properly?
a
by default, but the employees might change it. So after record submit wouldn't be optimal. Sometimes the due date is in the past due to company policies
And i want them to change it before saving
I get a result but in the wrong format when I use this function: nlapiAddDays(nlapiStringToDate(nlapiGetFieldValue('custbody_issue_date')), 5)
This is the date result: Wed Jan 19 2022 000000 GMT+0100 (Mitteleuropäische Normalzeit)
Is it possible to format the result to D/M/YYYY?
a
Can you put TO_DATE( (formula), ‘D/M/YYYY’) around that entire formula?
a
Unfortunately this resultet into an infinite loop