Valerie Giese
09/17/2024, 9:13 PMCeligo AI
09/17/2024, 9:13 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that the "Adjust Qty. By" field is a standard field in NetSuite's Inventory Adjustment transaction and it's not directly possible to remove it as a required field. However, you can automate the process of filling this field by using SuiteScript. You can create a User Event script that triggers on the beforeSubmit event of the Inventory Adjustment record. This script would iterate over the line items, sum the quantities from the Inventory Detail subrecord, and then set this sum in the "Adjust Qty. By" field. Here is a sample code snippet that might help:
javascript
function beforeSubmit(scriptContext) {
if (scriptContext.type !== scriptContext.UserEventType.CREATE && scriptContext.type !== scriptContext.UserEventType.EDIT) {
return;
}
var record = scriptContext.newRecord;
var lineCount = record.getLineCount({sublistId: 'inventory'});
for (var i = 0; i < lineCount; i++) {
var detailSubrecord = record.getSublistSubrecord({
sublistId: 'inventory',
fieldId: 'inventorydetail',
line: i
});
var detailCount = detailSubrecord.getLineCount({sublistId: 'inventoryassignment'});
var totalQty = 0;
for (var j = 0; j < detailCount; j++) {
var qty = detailSubrecord.getSublistValue({
sublistId: 'inventoryassignment',
fieldId: 'quantity',
line: j
});
totalQty += qty;
}
record.setSublistValue({
sublistId: 'inventory',
fieldId: 'adjustqtyby',
line: i,
value: totalQty
});
}
}
This script assumes that the Inventory Detail subrecord is on the 'inventory' sublist and that the quantity field on the Inventory Detail subrecord is 'quantity'. You may need to adjust these field and sublist IDs to match your actual setup.
******
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/17/2024, 9:14 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839203894
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.8384673
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837753534
Celigo AI
09/17/2024, 9:14 PMValerie Giese
09/17/2024, 9:14 PMCeligo AI
09/17/2024, 9:15 PMCeligo AI
09/17/2024, 9:15 PMCeligo AI
09/17/2024, 9:15 PMCeligo AI
09/17/2024, 9:15 PMCeligo AI
09/17/2024, 9:15 PMValerie Giese
09/17/2024, 9:17 PMrico
09/17/2024, 10:12 PMValerie Giese
09/18/2024, 9:23 PM