How to get currently logged in employee details in Netsuite using Suitescript when viewing customer?

跟風遠走 提交于 2019-12-12 22:08:59

问题


I need to get the currently logged in employee details like internal ID etc., When the employee views the particualar customer record. So that i can save the staff who actually visited lastly the customer in our own site.


回答1:


Try using the current attributes:

<%=getCurrentAttribute('customer','entityID','Guest')%>

or

<%=getCurrentAttribute('customer','internalid')%>">



回答2:


"nlapiGetContext()" is the API you should be calling in a script. It returns a "nlobjContext" object containing information (metadata) about the current user or script context.

  • Deploy a "User Event on BeforeLoad Event"/"Client Script on PageInit Event" for the Customer Record Type.

  • Call the NetSuite API nlapiGetContext() to get all the pertinent details of the logged in user viewing the Customer Record. Your employee need not necessarily submit the Customer Record and deploying the script on beforeLoad/PageInit will still get you the data of the user accessing the record.

  • To get the internal id of the user specifically, you could add the below line in your script nlapiGetContext().getUser()




回答3:


Do a workflow and on "view" state y try saving the field by either the workflow actions or a nlapiSubmitField call.



来源:https://stackoverflow.com/questions/27545193/how-to-get-currently-logged-in-employee-details-in-netsuite-using-suitescript-wh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!