RE: Get Current Record ID in the Client Script
Hello, I have a button created with the client script on a inventory item record. On clicking the button, it opens up a suitelet in new window. I want to store the inventory item record internal id and then pass it to the suitelet to save it in a field. I tried using context for getting currentRecordId, but am unsuccessful. Please help me in solving this.
Thanks.
Try currentRecord.get().id, that should contain the id of the record. context.currentRecord would not have the id since the context of the record would not be passed to the client since its just being called by a button.
tyn
If you are using suitescript 1 you can use
if you are using suitescript use n/record or n/currentRecord 2