Shane Brown
01/19/2022, 9:13 PMform.clientScriptModulePath
and this is working fine.
When the user submits the form with a POST, the Suitelet returns a list to the user. When I try adding a client script to the list using the same method, list.clientScriptModulePath
, I get a SuiteScript error. The error is "Your connection has timed out. Please <a href='/pages/login.jsp' target='_self'>log in</a> again." I also get the same error when using list.clientScriptFileId
Any ideas why I can add a client script on the form but get this error when adding a client script on the list?battk
01/20/2022, 10:34 AMbattk
01/20/2022, 10:34 AMShane Brown
01/21/2022, 12:50 AM// create a new form
let form = serverWidget.createForm({
title: 'External Suitelet',
hideNavBar: true
});
// set the client script
form.clientScriptModulePath = './BSL_2.1_Client_ExternalSearch_Form.js';
I then add some fields to the form and use context.response.writePage(form);
to show the form. This is the part that is working without issues.
I set the client script on the list like this
let list = serverWidget.createList({
title: 'An External Suitelet List'
});
list.clientScriptModulePath = './BSL_2.1_Client_ExternalSearch_List.js';
list.addButton({
id: 'custpage_btn_goback',
label: 'Go Back',
functionName: `goBack`
});
This returns the error that I mentioned earlier.
This is the client script that I am trying to add to the list (just testing an alert right now)
define([], function () {
let exports = {};
function pageInit(context) {
// TODO
}
function goBack() {
alert('The Go Back button was clicked.');
}
exports.pageInit = pageInit;
exports.goBack = goBack;
return exports;
});