netsuitesuitescriptsuitescript2.0sublistclientscript

Is it possible to track sublistChanged events in client script 2.0?


I want to know, is that possible that we can track whether the sublist button user has pressed is Add/Insert/Delete, after populating all of the mandatory sublist fields, under sublistChanged entry point of client script 2.0. (For e.g.):

/**
 *@NApiVersion 2.0
 *@NScriptType ClientScript
 */
define([], function() {


    function sublistChanged(c) {
        if(c.mode == "add"){
            //Some Code
        }
        else if(c.mode == "insert"){
            //Some Code
        }
        else if(c.mode == "delete"){
            //Some Code
        }
    }

    return {
        sublistChanged: sublistChanged
    }
});

Thanks in advance.


Solution

  • As Brian said in a comment, the API provides three other entry points that trigger for those cases:

    These each require a boolean return value to allow or deny the operation.