can i hide a sublist column with SuiteScript 1.0 i...
# ask-stanley-ai
r
can i hide a sublist column with SuiteScript 1.0 in a client script
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** In SuiteScript 1.0, you cannot directly hide a sublist column in a client script. However, there are workarounds to achieve similar results. One way is to create a custom sublist and handle the user's actions in the custom sublist to apply to the real sublist. This way, there isn't even an option to add new lines as the sublist is of a type that doesn't allow it. Another way is to disable specific columns on each line item. Here is a code snippet that demonstrates this:
Copy code
javascript
// List of column IDs to disable
var columnsToDisable = ['description', 'price', 'rate']; // Add more column IDs as needed

for (var i = 0; i < lineCount; i++) {
    // Disable specific columns on each line item
    columnsToDisable.forEach(function(columnId) {
        currentRecordObj.getSublistField({
            sublistId: 'item',
            fieldId: columnId,
            line: i
        }).isDisabled = true; // Set to true to disable the field
    });
}
Please note that these are workarounds and may not work in all scenarios. Always test your code thoroughly before deploying it to a live environment.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.861735702
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.855296075
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84885323
Please provide your feedback on this answer.