I am using var recordOwner = nlapiLookupField('sal...
# suitescript
m
I am using var recordOwner = nlapiLookupField('salesorder', idToCheck, 'entity'); to fetch the record in service controller. And this query is not returning any record and when I run the same query on my console it provides me the data. Can anyone help ?
n
Which script type is it?
m
SS 1.0
n
I meant is it a UE or client script?
m
backend Suitescript file
n
This should work in that case. And should return the value: var recordOwner = nlapiLookupField('salesorder', <salesorderid>, 'entity'); You might want to log the salesorderid before you do the lookup and see if that's indeed the correct id.
m
yes the id is correct and still not able to get the data.
b
what role is the deployment and does that role have access to the sales order
m
yes I have given elevated permission and the role has the following permission
b
i advise logging in via that role and seeing if you can search for that sales order
m
yes I am able to search that sales order
b
and you can do the lookup in the console
m
res in that I am able to get the data
b
too weird, I would have guessed permission issue but your followup suggests otherwise
unless your employee is unusual and has been given global permissions
n
Could be a permissions issue with the script though, Check what role does script run on, as current user or any other role. Also, then log the role when you run the script from wherever you are running, let's see what role does that log.
m
how can print the role in service ?
n
In your Suitelet. I am assuming it is Suitelet/Restlet just do a var userRole = nlapiGetRole( ); and print it's value. Also, can you share a screen-shot your your deployment screen.