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.