Kevin Baxter
06/16/2023, 4:51 PMconst beforeSubmit = (scriptContext) => {
var newRecord = scriptContext.newRecord
var oldRecord = scriptContext.oldRecord
var value = newRecord.getValue({
fieldId: 'custitem6'
})
var objRecord = record.load({
type: record.Type.INVENTORY_ITEM,
id: 409,
isDynamic: true,
});
var value = objRecord.selectLine({
sublistId: 'price1',
line: 1
})
var headerField = objRecord.setCurrentMatrixSublistValue({
sublistId: 'price1',
fieldId: 'price',
column: 1,
value: 200
});
battk
06/16/2023, 5:21 PMKevin Baxter
06/16/2023, 5:22 PMbattk
06/16/2023, 5:23 PMKevin Baxter
06/16/2023, 5:23 PMbattk
06/16/2023, 5:24 PMbattk
06/16/2023, 5:27 PMKevin Baxter
06/16/2023, 5:58 PMvar itemRecord = record.load ({
type: record.Type.INVENTORY_ITEM,
id: itemId
});
var qtyPriceSchedule = itemRecord.getValue({
fieldId: 'quantitypricingschedule'
});
// Set the base price
var basePrice = 100;
// You must select, set, and then commit the sublist line you want to change.
itemRecord.selectLine({
sublistId: priceID,
line: 1
});
itemRecord.setCurrentMatrixSublistValue({
sublistId: priceID,
fieldId: 'price',
column: 1,
value: basePrice
});
itemRecord.commitLine({
sublistId: priceID
});
// Get the number of columns in the price matrix
// Each column represents a different quantity level
columnCount = itemRecord.getMatrixHeaderCount({
sublistId: priceID,
fieldId: 'price'
});
Kevin Baxter
06/16/2023, 5:58 PMKevin Baxter
06/16/2023, 5:58 PMKevin Baxter
06/16/2023, 5:58 PMKevin Baxter
06/16/2023, 5:58 PMbattk
06/16/2023, 6:40 PMbattk
06/16/2023, 6:41 PM