Hi <@U5TF1GQ20>, I have attached the script param...
# suitescript
p
Hi @battk, I have attached the script parameters as below please have a look
Object of name/values used in this scheduled script instance - used to override the script parameters values for this execution.
p
I followed the same thing
b
its not permanent
and im not sure if using it that way works if its company level
p
So can you point me where I have gone wrong ?
b
you dont set script parameters using nlapiScheduleScript
it only sets the value for the deployment
and only for the specific instance of the deployment scheduled
its not permanent
p
Right so thats what I dynamically created deployment script and then passing the parameters to it
Copy code
var deploymentID = '13228';
var params = {
            custscript_dummy_deployment_id: "1234"
        }
var status = nlapiScheduleScript('customscript_dummy_script', deploymentID, params);
b
reasonable, bu so far you have shared no code showing how you get the parameter
which makes me believe you arent getting it, especially since its a company level preference that probably cant be changed at the deployment level
p
I have removed the preference now and set it as blank
Copy code
var deploymentID = '13228';
var params = {
custscript_dummy_cart_id: '1234',    custscript_dummy_deployment_id: "1234"
        }
var status = nlapiScheduleScript('customscript_dummy_script', 'customdeploy13', params);
message has been deleted
b
good, now where is the code getting the script parameter
p
okay can you send me a snippet of it ?
Because I just need to set the parameter value then I shouldn't read the parameters
Check this one, In this they haven't read the parameters
you read the value of the script parameter in the scheduled script that you scheduled
p
I want to set the values @battk
So for setting the values dynamically in deployment script we should read the parameter name first because values will be empty right
b
its basically the first thing i told you
you dont set script parameters using nlapiScheduleScript
you can use nlapiScheduleScript to temporarily set the value for the deployment that you scheduled
but its not permanent
p
Okay got it Thank you so much
One last thing in deployment Id can I pass Id value which we get in url when we create deployment script
@battk
b
i dont think so. script deployments dont support client script or user events
you should be able to set your script parameters by loading the script deployment as a record and setting the script parameter like its a field
p
Okay I will try this out thanks
but how can I get deployment Id with the help of url parameter Id ?
b
thats the internal id of the deployment
you would not need to set that
p
but in this I will need to send deployment ID nlapiScheduleScript('customscript_dummy_script', deploymentID, params);
b
im not sure what you are trying to do
but you will usually have either the script id (customdeploy14) or the internal id (1322)
you can use one to do a search on script depoyments to get the other
take a look at the methods on an nlobjContext so you know what you have access to: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3077939.html
p
Cool thank you so much (Y)