Can we Load Script record type using Netsuite's Suite Script?
Hi All,
Script and Deployment, if you notice, have fields and internal ids. If you click on any label you will see internal id of that.
We can even make search on Script and get Data from Script Record.How ever I notice that we can not get
library files and supporting files. Many of body fields are allowed in Saved Search column.
Due to limitation for library files I tried to load the script and try to see if we can load it or not.
Steps I followed:
Step 1: make a saved search on Script Record type and add columns which a available.
Step 2: get Script Record Type , surprisingly record type is not as coming as what we need. I added few below:
Type In Search | Type Required |
action | workflowactionscript |
client | clientscript |
userevent | usereventscript |
scheduled | scheduledscript |
scriptlet | suitelet |
Now to fix this issue I used if condition as below :
var stype = results[i].getRecordType();
if(stype == 'action')
{
stype = 'workflowactionscript';
}
if(stype == 'client')
{
stype = 'clientscript';
}
if(stype == 'userevent')
{
stype = 'usereventscript';
}
if(stype == 'scheduled')
{
stype = 'scheduledscript';
}
if(stype == 'scriptlet')
{
stype = 'suitelet';
}
Step 3: try to load record : after this I tried to load record
Got Error Saying :
YOU_HAVE_NO_PERMISSION_TO_LOAD_THIS_RECORD Details: You have no permission to load this record.
This means we can not load any script , but here is a catch, We can not load other script but we can load same script it self. What it means that script is allowed to load it self but not any other script.
So when I tried to load script inside same script it gives me result.
Now the conclusion is you can load script but inside same script .
Please share your thoughts or let everyone know if you know how to load other script inside one script.
Thanks
Abhi
Comments
Post a Comment
Thanks for you message, please join us on Facebook and Linkedin