I am new to SuiteScript and I can't seem to fully understand adding url parameters on redirects. I know that the SuiteScript 1.0 documentation states that extra parameters can be added according to this function:
sendRedirect(type, identifier, id, editmode, parameters)
type {string} [required] - The base type for this resource
identifier {string} [required] - The primary id for this resource (record type ID for RECORD, scriptId for SUITELET, taskId for tasklink, url for EXTERNAL)
id {string} [optional] - The secondary id for this resource (record type ID for RECORD, deploymentId for SUITELET)
editmode {boolean true || false} [optional] - For RECORD calls, this determines whether to return a URL for the record in edit mode or view mode. If set to true, returns the URL to an existing record in edit mode, otherwise the record is returned in view mode.
parameters {hashtable} [optional] - An associative array of additional URL parameters as name/value pairs
But I am really confused on the last fourth parameter where the documentation states that an associative array is needed. I have tried writing this code to test adding that parameter.
function suitelet(request, response) {
var arrayParam = [];
arrayParam.push({custparam_key: 'value'});
response.sendRedirect('SUITELET', 'customscript_a', 'customdeploy_a',
arrayParam);
}
But I am unable to track down where that last parameter is located in my Suitelet. The above code does allow the user to redirect back to the same form itself with additional default parameters. But I don't want the same default parameters. I want to be able to make additional custom parameters on certain conditions where I need to redirect the user.
I hope that all made sense. I feel like maybe I am not understanding what that last parameter is used for. If that is the case, then any clarification would be helpful!
{ a: 'aa', b: 'bb' }
)? – Avi