Ben Goligowski
01/30/2023, 4:55 PMReferenceError onReceiveButtonClick is not defined
I'm trying to create a button to do stuff on an item receipt (i don't think it will work, but testing to be sure) and I can't even call the function defined in the client script without getting this error. The function is defined in the CS and just has an alert in it for now for testing and the button is defined on the script record in NS with the function being the one specified in the CS. It's in return in the CS as well. I've deleted the deployment and recreated as well, no luck.
define(['N/currentRecord', 'N/error', 'N/log'],
/**
* @param{currentRecord} currentRecord
* @param{error} error
* @param{log} log
*/
function(currentRecord, error, log) {
/**
* Function to be executed after page is initialized.
*
* @param {Object} scriptContext
* @param {Record} scriptContext.currentRecord - Current form record
* @param {string} scriptContext.mode - The mode in which the record is being accessed (create, copy, or edit)
*
* @since 2015.2
*/
function pageInit(scriptContext) {
// TODO
}
function onReceiveButtonClick() {
alert("I worked!");
}
return {
onReceiveButtonClick: onReceiveButtonClick,
pageInit: pageInit
};
});
NickSuite
01/30/2023, 6:38 PMNickSuite
01/30/2023, 6:38 PMerictgrubaugh
01/30/2023, 7:18 PMonReceiveButtonClick
is in the return
statement in the file that's actually deployed in NetSuite, and then clear your browser cache as Client Script content is quite often cached.Ben Goligowski
01/30/2023, 8:24 PMerictgrubaugh
01/30/2023, 8:24 PMBen Goligowski
01/30/2023, 8:24 PMBen Goligowski
01/30/2023, 8:24 PMBen Goligowski
01/30/2023, 8:24 PMBen Goligowski
01/30/2023, 8:26 PMbattk
01/31/2023, 12:58 AMbattk
01/31/2023, 12:59 AMerictgrubaugh
01/31/2023, 3:05 AMerictgrubaugh
01/31/2023, 3:05 AMthe button is defined on the script record in NS with the function being the one specified in the CS
battk
01/31/2023, 3:12 AMbattk
01/31/2023, 3:13 AMerictgrubaugh
01/31/2023, 3:25 AMbattk
01/31/2023, 3:33 AMbattk
01/31/2023, 3:33 AMBen Goligowski
01/31/2023, 4:52 AM