In RESTlet script, I am trying to preform simple s...
# suitescript
d
In RESTlet script, I am trying to preform simple search for customer by custom field, but when I am execute the script I get 0 results, when I try same code on console I get results, I have the relevant premission for customer list, what else should i look for?
n
Do you want to share your code incase it's not the search but the flow/logic, fresh eyes may help
d
Copy code
let customerSearch = search.create({
                    type: 'customer',
                    filters:
                        [
                            ["custentity12", "is", customerSfdc]
                        ],
                    columns:
                        [
                            search.createColumn({name: "internalid", label: "Internal ID"})
                        ]
                });
                let customerResults = customerSearch.run().getRange(0, 1);
The exact same code works on consolke
n
and you have output the value of "customerSfdc" to know that's correct?
d
yes its correct, is a string
n
maybe try removing the filter to see if it returns anything.
d
same resutls...
maybe its something in premissions of the role
n
but you get no permission violation right?
d
no errors
n
I would have thought you'd have an error if it was permissions
d
Yeah me too.. but its strange
@NElliott so I have found the problem, its was with the role subsidiaries, I switched ACCESSIBLE SUBSIDIARIES to ALL instead of USER SUBSIDAIRY
becouse the user subsidairy is parent company and the customer are not
n
Glad you got this sorted, it's curious to me that you had no role specific error message 🤔