Marc
09/09/2024, 6:02 PMCeligo AI
09/09/2024, 6:02 PMAI generated answer (using internal Slack threads):It seems like the issue you're facing is related to the way NetSuite handles item groups. When you use an item group, the components of the group only trigger the sublistChanged entry point, which might be why your client script isn't firing as expected. To handle this, you might need to modify your script to listen for the sublistChanged event and then perform the necessary actions for each line in the item group. This could involve iterating over each line in the sublist when the sublistChanged event is triggered and applying your pricing logic to each line. Here's a rough example of how you might structure this:
javascript
function sublistChanged(scriptContext) {
if (scriptContext.sublistId === 'item') {
var itemCount = scriptContext.currentRecord.getLineCount({sublistId: 'item'});
for (var i = 0; i < itemCount; i++) {
var item = scriptContext.currentRecord.getSublistValue({
sublistId: 'item',
fieldId: 'item',
line: i
});
// Apply your pricing logic to the item here
}
}
}
Remember to replace the comment with your actual pricing logic. This code will run whenever an item is added to the sublist, and it will apply your pricing logic to each item in the item group.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
09/09/2024, 6:03 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.854930043
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843043625
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83704865
Celigo AI
09/09/2024, 6:03 PM