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.currentRecord
       currentRecordRecord.getValue({
           fieldId: 'duedate'
       })
       var dataCondicoes = context.currentRecord
       currentRecord.getValue({
           fieldId: 'terms'
       })
    }
    return {
        beforeLoad: beforeLoad,
        beforeSubmit: beforeSubmit,
        afterSubmit: afterSubmit
    }
});
Rookie Asked on July 29, 2021 in SuiteScript.
Add Comment
1 Answer(s)

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!

Beginner Answered on August 2, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor