1

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.

  • There are more specific entry points like validateDelete, validateInsert and validateLine. – Brian Mar 15 '21 at 14:41
  • 1
    Dear Brian, thanks for your comment! yes that's the only way to make it specific. I searched for that alot and end up using validateLine entry point to make the script run specifically when the user will press ADD button – Muhammad Kamran Mar 16 '21 at 05:50

1 Answers1

0

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

  • validateLine for line additions
  • validateInsert for line insertions
  • validateDelete for line deletions

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

Adam
  • 3,829
  • 1
  • 21
  • 31
  • Dear Adam, thanks for the answer, yes you are right we can control execution of some sublist actions like(ADD, REMOVE & INSERT) of user by returning TRUE/ FALSE in these entry points. – Muhammad Kamran Mar 29 '21 at 09:11