Fill duedate field based on value of terms field
Need help. Is it possible to fill the duedate field based on the terms field? For example, I have a date in the duedate field, but I want to extend it based on the terms field. It’s possible? Which way? Through Suitescript or workflow.
What I’m trying to do in the code, get the value of the duedate field and the terms field, and then fill in the duedate field. Do you understand? The code is incomplete yes, because I don’t know if I’m on the right path.
/***@NApiVersion 2.x*@NScriptType UserEventScript*/define(['N/record'], function(record) {function beforeLoad(context) {}function beforeSubmit(context) {}function afterSubmit(context) {var dataEntrega = context.currentRecordcurrentRecordRecord.getValue({fieldId: 'duedate'})var dataCondicoes = context.currentRecordcurrentRecord.getValue({fieldId: 'terms'})}return {beforeLoad: beforeLoad,beforeSubmit: beforeSubmit,afterSubmit: afterSubmit}});
This can definitely be achieved via simple workflow action.
Set Field Value/After Record Submit.
Field = Due Date
Formula = {duedate} + {terms.daysuntilnetdue}
Please mark this as the best answer if this works for you. Thanks!