Cross posting this here: Good day all! I was wonde...
# suiteql
a
Cross posting this here: Good day all! I was wondering if someone could give me some insight into why this suiteql query isn't working?
select vendor.id, vendor.firstname, vendor.lastname, vendor.email, vendor.isinactive from vendor where isperson = 'T' union select employee.id, employee.firstname, employee.lastname, employee.email, employee.isinactive from employee
I'm just trying to get back all people that are vendors and employees but I just keep getting a generic unexpected error that doesn't mention what was wrong.
c
That query runs fine for me. • Do the separate queries that you're attempting to UNION run fine on their own? • Does the role you're running the query under have the correct permissions?
a
• Yep, I can get the employees and vendors separately. • I am authed in as an Administrator. Is there some other special feature or setting I might need to turn on @Clay Roper? I am extremely new to Netsuite and we have a pretty vanilla setup. I was using postman to try this but I also just updated the query locally for me and its failing there too so it's not postman.
@Clay Roper got it!
select t.* from ((select id, firstname, lastname, email, isinactive from vendor where isperson = 'T') union (select id, firstname, lastname, email, isinactive from employee)) t
c
Interesting, I wonder what's different between our environments that this is the case. When you say you run the query locally, how are you doing so?
Either way, I'm glad you got it to work 🎉
a
Thanks! 🙂 I'm not sure, maybe its a difference between the rest endpoint and using it in a restlet? Possibly a rest bug but with just an
unexpected_error
I can't be fully sure.