Dhananjay Donthula
12/19/2019, 9:50 AM/**
*@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
}
});Zeeshan
12/19/2019, 11:12 AMZeeshan
12/19/2019, 11:12 AMZeeshan
12/19/2019, 11:13 AM/**
*@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
}
});Zeeshan
12/19/2019, 11:14 AMDhananjay Donthula
12/19/2019, 11:26 AM/**
*@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
};
});Dhananjay Donthula
12/19/2019, 11:27 AMDhananjay Donthula
12/19/2019, 11:29 AMZeeshan
12/20/2019, 2:12 PMZeeshan
12/20/2019, 2:12 PM