This article is relevant if you are working in NetSuite and you need to update a field but it is presented as read only.
Background
Often times, NetSuite form definitions will present information in a read only fashion. This can be set by using the “Inline HTML” or “Disabled” Display Type definitions in the Custom Form definitions. However, there may be times that you need to quickly change information on a record and you don’t want to revert to using another form or performing a CSV update.
Learn the Quick Browser Inspect Mechanism to Modify NetSuite Field Values
Because NetSuite is a web browser application, we have the ability to inspect programmable client-side elements of the system. The trick then is to learn how to “inspect” those programming elements so they can be manipulated. I personally use Google Chrome as my primary browser. To get to Chrome’s Developer Tools on a Mac, use keyboard sequence Alt-Command-I to pop open a console (see associated image for a menu option). All the major browsers have an equivalent mode of operation.
Once the console is open, you need to know the internal field ID of the element you wish to modify. See this article on how to view internal field IDs in the NetSuite application. With that information in hand, you need to issue the following NetSuite SuiteScript API command:
nlapiSetFieldValue('[your internal field id]', '[your value]')
See associated image for an element I wished to update. I typed the command and pressed Enter on the keyboard. At the point, I could see the value had changed on the form indicating I did it right. Once the read only value was updated, I saved the record as normal. Fast!
Let’s Work Together to Make Using NetSuite Better
If you are a NetSuite power user or consultant, and you hold high standards for care, perhaps we can help others get more from the platform. Let’s have a conversation.
Just wanted to say thank you for posting this article. It is a true life saver.
How can I do this as a check box? I’m not sure what the value would be to add at the end.
Checkbox values are “F” or “T” to UnCheck or Check the box when working in this mode.
Marty
Good Afternoon Marty!
Firstly, I’d like to thank you for providing all of these wonderful resources. They have been immense help more times than I can count!
We are trying to set itemsource to phatom in an afterSubmit hook on work orders and having no luck.. Is it possible that item source is read only in this context?
Eric,
I don’t have a specific answer. afterSubmit seems late in the process. I assume that you are working in script. We find that we often need to perform trial and error to get the results we want. When all else fails including searching for what others did, we revert to NetSuite Support.
Marty