Hi all,
We have a BeforeLoad User Event script for the Credit Memo form that works fine when creating a Credit Memo. We just had a request to reformat the printed version of the credit memo and we are trying to customize an Advanced PDF/HTML template. We click on the standard template to customize it and every time we get an error:
org.mozilla.javascript.EcmaError: TypeError: Cannot find function getAllParameters in object http.ServerRequest. (/SuiteScripts/PE Scripts 2.0/pe2_ue_creditmemo.js#27)
First, not sure why it is running the script when we are trying to create a custom template.
The line it is hanging up on is when we get a custom parameter we have passed to the form when creating a Credit Memo from a Case. Like I said, the script works just fine when created a Credit Memo either from a Case or just creating a new one independent of a case
Here is the code. We do not even try to use the getAllParameters function in our code.
/**
* @NApiVersion 2.x
* @NScriptType UserEventScript
* @NModuleScope SameAccount
*/
define(['N/record', 'N/url', 'N/runtime'],
function(record, url, runtime) {
function beforeLoad(scriptContext) {
if (runtime.getCurrentUser().name == 'WebService NSPOS') { return; }
request = scriptContext.request;
var recid = request.parameters.caseid;
This last line is where it dies every time.
I have tried various things without success. Any ideas?
Thanks,
Karen