can a client script in a suitelet update a disable...
# ask-stanley-ai
b
can a client script in a suitelet update a disabled field on a sublist
c
AI generated answer (using internal Slack threads):
Based on the conversations provided, it appears that a client script in a Suitelet can update a disabled field on a sublist, but there are certain limitations and considerations to keep in mind. Firstly, it's important to note that in a client script, you only have access to a
currentRecord
, so you can only get to the field. You can use
currentRecord.getSublistField
to access the field and set it to
.isDisabled=true
. However, this seems to work in the
lineInit
function, but not on
fieldChanged
or
validateField
. This is likely due to how NetSuite handles field states and calculations. Here is an example of how you might disable a field:
Copy code
javascript
scriptContext.currentRecord.getSublistField({
    sublistId: 'item',
    fieldId: 'amount',
    line: 0
}.isDisabled = true
However, it's worth noting that NetSuite may not respect this choice, especially if the field is used for calculations. If you want to disable adding to a sublist in the UI but enable checking a box and adding rows in a client script, one approach could be to set the other column to be disabled or inline when generating them in the code. Another approach could be to hide the real sublist and add a custom one in Beforeload, adding all columns and checkboxes that you want. In before submit, you can handle what the user has done in the custom sublist to apply to the real sublist. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851197
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.850148916
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.849997282
Please provide your feedback on this answer.