0
votes

I'm not even sure what I am trying to achieve is even possible, so please allow me some latitude. I am new to working in Netsuite, but have managed to fumble through so far, until now.

We want to show on a purchase order form, the amount remaining in the budget for the account, current fiscal period and department. The problem is that the majority of users will be raising orders from the Employee Centre and the Employee Centre user does not (and will not) have permission to search the budgetimport "table".

I have learned that suitelets can be executed with Admin privileges, so this might be the answer to perform the search and return the budget value to the client script (pageInit) running in the purchase order form. I cannot see where to configure this? How can I pass the variables from my client script to the suitelet?

With the user logged into the Employee Centre, I can get their account, department and the current fiscal period, so can provide these are arguments to the (I'm assuming I need a suitelet?) function. The search I have executes correctly and returns the correct value, only if you have the right permissions to perform the search.

Am I barking up the right tree? Or, barking mad?

TIA

3

3 Answers

0
votes

You can pass the values as URL parameters when you call the Suitelet

0
votes

You may also want to consider using a RESTlet, which allows you to configure a basic endpoint for transferring data.

0
votes

You're idea is feasible. First, create a back-end suitelet which executes as administrator. Perform the search you want there and return the result as JSON obj in its response. Then, in your client script, you can use nlapiResolveUrl to dynamically get the suitelet url. Use nlapiRequestUrl api to create a request to that url and submit the parameters via POST method.