Robert Vice
05/22/2024, 1:37 PMissueinventorynumber
for 25000+ items.
I've attempted to insert an array of inventorynumbers and internalids without any luck. Could this be because of a type issue, string for inventorynumber and number for internalid?
The problem, adding 25000 items 1by1 takes over 3600 seconds (20599 is about that time). We're filling a Transfer Order with this quantity.battk
05/22/2024, 2:27 PMbattk
05/22/2024, 2:27 PMbattk
05/22/2024, 2:27 PMRobert Vice
05/22/2024, 2:41 PMidLineCount = 0; // For IF, this is true. IR it can be whatever the IF count is up to 10,000
lineItem.serialIds?.forEach((serial, serialIndex) => {
if (0 < idLineCount) {
// Attempted workaround for Case # 5737571 DIGBIZ-1155
inventorySubrecord.selectNewLine({
sublistId: 'inventoryassignment'
});
} else {
// Add based on index offset by what's already there, selectNewLine doesn't work if there's nothing there
inventorySubrecord.selectLine({
sublistId: 'inventoryassignment',
line: idLineCount + serialIndex
});
}
inventorySubrecord.setCurrentSublistText({
sublistId: 'inventoryassignment',
fieldId: record.Type.ITEM_RECEIPT == sourceRecordType ? 'receiptinventorynumber' : 'issueinventorynumber',
text: serial,
fireSlavingSync: false,
forceSyncSourcing: true
});
inventorySubrecord.commitLine({ sublistId: 'inventoryassignment' });
});
I've tried to change serial
to an array with a splice of ~100, but I get an issue when I try the inventorynumber of the device. I suppose I can test ..sublistValue() with the internal ID's, but I assume I'll get the same error.
I'll take a look at the dynamic mode too.Robert Vice
05/22/2024, 2:51 PMRobert Vice
05/22/2024, 3:02 PMidLineCount = 0; // True for IF, IR can be IF Qty up to 10000
const spliceSize = 100;
const originalSerialLength = serialsToSet?.length;
for (let i = 0; i < serialsToSet?.length; i++) {
let actualSpliceSize = spliceSize;
// Check if less than splice size
if (serialsToSet.length < spliceSize) {
actualSpliceSize = serialsToSet.length;
}
log.debug({
title: `${sourceRecordType} Inventory Detail`,
details: `Inserting chunck ${actualSpliceSize} for total ${i * actualSpliceSize} out of ${originalSerialLength}`
});
const serialsToAdd = serialsToSet.splice(0, actualSpliceSize);
if (0 < idLineCount) {
// Attempted workaround for Case # 5737571
inventorySubrecord.selectNewLine({
sublistId: 'inventoryassignment'
});
} else {
// Add based on index offset by what's already there, selectNewLine doesn't work if there's nothing there
inventorySubrecord.selectLine({
sublistId: 'inventoryassignment',
line: idLineCount + (i * actualSpliceSize)
});
}
// Bulk add with array of values
inventorySubrecord.setCurrentSublistText({
sublistId: 'inventoryassignment',
fieldId: record.Type.ITEM_RECEIPT == sourceRecordType ? 'receiptinventorynumber' : 'issueinventorynumber',
text: serialsToAdd,
fireSlavingSync: false,
forceSyncSourcing: true
});
inventorySubrecord.commitLine({ sublistId: 'inventoryassignment' });
}
battk
05/22/2024, 3:05 PMbattk
05/22/2024, 3:05 PMRobert Vice
05/22/2024, 3:06 PMbattk
05/22/2024, 3:06 PMRobert Vice
05/22/2024, 3:07 PMbattk
05/22/2024, 3:28 PMRobert Vice
05/22/2024, 4:12 PMinternalid
for the item fulfillment. Is the suggestion here then to use setSublistValue instead of setSublistText for the itemfulfillment?battk
05/22/2024, 4:13 PM