```/** *@NApiVersion 2.0 *@NScriptType ClientScrip...
# suitescript
d
Copy code
/**
*@NApiVersion 2.0
*@NScriptType ClientScript
*/
define([], function (){
	var pageInit = function() { } //just to add an entry point

	var customSubmit = function() {
		log.debug("sss");
	}
return {
		pageInit: pageInit,
	    customSubmit: customSubmit
}
});
z
Make sure if your client script is loaded on the form/record.
then change your method name like this
Copy code
/**
*@NApiVersion 2.0
*@NScriptType ClientScript
*/
define([], function (){
	var pageInit = function() { } //just to add an entry point

	var customSubmit2 = function() {
		log.debug("sss");
	}
return {
		pageInit: pageInit,
	    customSubmit: customSubmit2
}
});
Try executing again and let me know what are the results you get?
d
Copy code
/**
 *@NApiVersion 2.x
 *@NScriptType Suitelet
 * Reports  Page - 12-17-2019
 */
define(["N/redirect", "N/runtime", "N/ui/serverWidget", "N/url"],
    function (redirect, runtime, ui, url) {
        function showPaymentForm(context) {
            var form = ui.createForm({
                title: 'Reports Payment Form'
            });
            log.debug("I m above");
            
            
            // var pageInits = function () {
            //     log.debug("I m pageinit");
            // }
            form.clientScriptModulePath = "../ClientScripts/PaymentValidation.js";
            form.addButton({
                id: 'custpage_cre_view_agreement',
                label: 'Print Retainer',
                functionName: 'restart'
            });


        
            context.response.writePage(form);
        }

        

        function onRequest(context) {
            if (context.request.method === 'POST') {
                var currentScript = runtime.getCurrentScript();
                log.debug("Params =>", context.request.parameters);
                var params = {};
                for (var k in context.request.parameters) {
                    if (k.indexOf('custpage_') == 0 && k.indexOf('custpage_transactions') == -1) {
                        if ((/^custpage_.*_display$/).test(k))
                            continue;
                        params[k] = context.request.parameters[k];
                    }
                }
                redirect.toSuitelet({
                    scriptId: currentScript.id,
                    deploymentId: currentScript.deploymentId,
                    parameters: params
                });
                return;
            }
            showPaymentForm(context);
        }
        return {
            onRequest: onRequest
        };
    });
I am calling from custom suitelet
@Zeeshan
z
I have done the same several times. it worked always.
could you please share the client script associated to it?