tuli
06/02/2021, 10:07 AMbattk
06/02/2021, 12:52 PMbattk
06/02/2021, 12:53 PMtuli
06/02/2021, 1:12 PMtuli
06/02/2021, 1:13 PMtuli
06/02/2021, 1:14 PMtuli
06/02/2021, 1:14 PMThe problem here is you don't get the internal id of receipts in return. I tried making a search to get the latest Item receipt for PO, but that doesn't give me any results. I think that is due to , when we receive through UI and submit Receive Inbound Shipment, that kind of triggers another job that creates Item receipts. (Same I am expecting in script, when we submit that record, that job to create Item reciept starts, but IR is not created yet)
battk
06/02/2021, 1:17 PMbattk
06/02/2021, 1:18 PMtuli
06/02/2021, 1:19 PMtuli
06/02/2021, 1:19 PMbattk
06/02/2021, 1:19 PMbattk
06/02/2021, 1:20 PMbattk
06/02/2021, 1:20 PMbattk
06/02/2021, 1:21 PMtuli
06/02/2021, 1:23 PMtuli
06/02/2021, 1:23 PMtuli
06/02/2021, 1:26 PMtuli
06/02/2021, 1:28 PMbattk
06/02/2021, 2:01 PMbattk
06/02/2021, 2:01 PMtuli
06/04/2021, 11:13 AMrequire(['N/record'], function(record) {
try {
var receiptRecord = record.load({
type: record.Type.ITEM_RECEIPT,
id: 712706,
isDynamic: false,
});
var receiptLineCount = receiptRecord.getLineCount({ sublistId: "item" });
for (var receiptLine = 0; receiptLine < receiptLineCount; receiptLine++) {
var currentItem = receiptRecord.getSublistValue({
sublistId: "item",
fieldId: "item",
line: receiptLine,
});
var prevQuantity = Number(
receiptRecord.getSublistValue({
sublistId: "item",
fieldId: "quantity",
line: receiptLine,
})
);
receiptRecord.setSublistValue({
sublistId: "item",
fieldId: "quantity",
line: receiptLine,
value: prevQuantity + 5,
});
}
var receiptId = receiptRecord.save({
enableSourcing: false,
ignoreMandatoryFields: true,
});
} catch (error) {
log.error({
title: 'Error in main',
details: JSON.stringify(error)
});
}
});
I am getting this. I am not using that function or field object anywhere.tuli
06/04/2021, 11:14 AMbattk
06/04/2021, 11:39 AMbattk
06/04/2021, 11:39 AMtuli
06/04/2021, 11:42 AMbattk
06/04/2021, 11:43 AMbattk
06/04/2021, 11:43 AMtuli
06/04/2021, 11:44 AMtuli
06/04/2021, 11:45 AMtuli
06/04/2021, 11:45 AMbattk
06/04/2021, 11:47 AMbattk
06/04/2021, 11:47 AMbattk
06/04/2021, 11:48 AMbattk
06/04/2021, 11:48 AMtuli
06/04/2021, 11:50 AMtuli
06/04/2021, 11:50 AMtuli
06/04/2021, 11:54 AMbattk
06/04/2021, 11:54 AMbattk
06/04/2021, 11:54 AMbattk
06/04/2021, 11:55 AMbattk
06/04/2021, 11:55 AMtuli
06/04/2021, 12:06 PMbattk
06/04/2021, 12:08 PMbattk
06/04/2021, 12:08 PMtuli
06/04/2021, 12:09 PMbattk
06/04/2021, 12:11 PMbattk
06/04/2021, 12:11 PMbattk
06/04/2021, 12:12 PMbattk
06/04/2021, 12:12 PMtuli
06/04/2021, 12:13 PMbattk
06/04/2021, 12:14 PMtuli
06/04/2021, 12:15 PMtuli
06/04/2021, 12:15 PMtuli
06/04/2021, 12:17 PMtuli
06/04/2021, 12:17 PMbattk
06/04/2021, 12:21 PMtuli
06/04/2021, 12:23 PMbattk
06/04/2021, 12:24 PMbattk
06/04/2021, 12:25 PMtuli
06/04/2021, 12:25 PMbattk
06/04/2021, 12:25 PMtuli
06/04/2021, 12:27 PMtuli
06/04/2021, 12:27 PMbattk
06/04/2021, 12:28 PMtuli
06/04/2021, 12:38 PMtuli
06/04/2021, 12:38 PMbattk
06/04/2021, 12:39 PMbattk
06/04/2021, 12:41 PMtuli
06/04/2021, 12:44 PMtuli
06/04/2021, 12:46 PM