Tyn Guardian
12/13/2023, 12:06 PMconst vendorBill = record.transform({
fromType: record.Type.PURCHASE_ORDER,
fromId: parseInt(purchaseOrderId),
toType: record.Type.VENDOR_BILL,
isDynamic: true,
defaultValues: {
'trandate': '2023-12-31',
'entity': parseInt(customerId),
'postingperiod': 323,
'subsidiary': parseInt(subsidiary),
'duedate': dateToday,
'currency': currency,
'exchangerate': exchangerate,
'location': location
}
});
I tried to check all the variables and they all have value, but still I am having this error message
"type": "error.SuiteScriptError",
_"name": "INVALID_RCRD_TRANSFRM",_
"message": "You have entered an invalid default value for this record transformation operation.",
"id": "",Tyn Guardian
12/13/2023, 12:06 PMNElliott
12/13/2023, 12:25 PMNElliott
12/13/2023, 12:26 PMTyn Guardian
12/13/2023, 12:29 PMTyn Guardian
12/13/2023, 12:44 PMconst vendorBill = record.transform({
fromType: record.Type.PURCHASE_ORDER,
fromId: 21953, // parseInt(purchaseOrderId),
toType: record.Type.VENDOR_BILL,
isDynamic: true,
defaultValues: {
'entity': parseInt(customerId),
}
});
const vendorBillId = vendorBill.save({
enableSourcing: true,
ignoreMandatoryFields: true
});
I get this error
You must enter at least one line item for this transactionNElliott
12/13/2023, 2:14 PMStuart Anderton
12/13/2023, 7:54 PMTyn Guardian
12/13/2023, 10:20 PMTyn Guardian
12/13/2023, 10:21 PMvendorBill.selectNewLine({sublistId:"item"});
vendorBill.setCurrentLineItemValue({
sublistId:"item",
fieldId: "item",
value: 260,
ignoreFieldChange: true
});
vendorBill.commitLineItem({sublistId: "item"});
Tyn Guardian
12/13/2023, 10:21 PMmichoel
12/13/2023, 11:15 PMTyn Guardian
12/13/2023, 11:18 PMmichoel
12/13/2023, 11:28 PMTyn Guardian
12/13/2023, 11:34 PMTyn Guardian
12/14/2023, 1:15 AMconst vendorBill = record.transform({
fromType: record.Type.PURCHASE_ORDER,
fromId: parseInt(21957),
toType: record.Type.VENDOR_BILL,
isDynamic: true,
defaultValues: {
'memdoc': parseInt(0)
}
});
var vendorBillId = vendorBill.save();
But no luck πTyn Guardian
12/14/2023, 1:40 AMTyn Guardian
12/14/2023, 1:54 AMconst vendorBill = record.transform({
fromType: record.Type.PURCHASE_ORDER,
fromId: parseInt(purchaseOrderId),
toType: record.Type.VENDOR_BILL,
isDynamic: true,
memdoc: 0,
});
var vendorBillId = vendorBill.save();
I've added memdoc as part of the parameter.. Thanks for the idea @michoel πAbhyuday Luthra
01/05/2024, 8:02 PMStuart Anderton
01/05/2024, 11:09 PMTyn Guardian
01/07/2024, 10:16 PM