How to validate mode on saveRecord() of a SuiteScript 2.0 Client Script

User wants to validate the mode in which the record is being accessed (create, copy, or edit) in the saveRecord function of a SuiteScript (SS) 2.0 Client Script.

define([], function(){
    	var currentMode; // declare a global variable

    	function pageInit(scriptContext) {
    		currentMode= scriptContext.mode;
    	}

    	function saveRecord(scriptContext) {
    		if(currentMode!= 'edit'){

    		}
    	}

    	return {
            pageInit: pageInit,
            saveRecord : saveRecord
        };
    });

Leave a comment

Your email address will not be published. Required fields are marked *