Stephen Elms
09/26/2020, 12:32 PMtdietrich
09/26/2020, 2:26 PM// Select the next sublist line.
theRecord.selectNewLine( { sublistId: 'itemvendor' } );
// Set the sublist values...
theRecord.setCurrentSublistValue(
{
sublistId: 'itemvendor',
fieldId: 'vendor',
value: 1234
}
);
theRecord.setCurrentSublistValue(
{
sublistId: 'itemvendor',
fieldId: 'purchaseprice',
value: 123.45
}
);
theRecord.setCurrentSublistValue(
{
sublistId: 'itemvendor',
fieldId: 'preferredvendor',
value: true
}
);
// Commit the sublist line.
theRecord.commitLine( { sublistId: 'itemvendor' } );
Stephen Elms
09/26/2020, 9:01 PMUSER_ERROR Please enter value(s) for: Vendor
Stephen Elms
09/26/2020, 9:04 PMbattk
09/26/2020, 9:19 PMStephen Elms
09/26/2020, 9:20 PMbattk
09/26/2020, 9:20 PMbattk
09/26/2020, 9:20 PMStephen Elms
09/26/2020, 9:33 PMbattk
09/26/2020, 9:35 PMbattk
09/26/2020, 9:36 PMrequire(["N/record"], function (record) {
console.debug(record.load({ type: "inventoryitem", id: 68 }).toJSON());
});
battk
09/26/2020, 9:36 PMbattk
09/26/2020, 9:38 PMtdietrich
09/26/2020, 10:32 PMStephen Elms
09/27/2020, 11:58 AMStephen Elms
09/27/2020, 12:24 PMUSER_ERROR Please enter value(s) for: Vendor
battk
09/27/2020, 12:52 PMbattk
09/27/2020, 12:52 PMbattk
09/27/2020, 12:57 PMtdietrich
09/27/2020, 2:54 PMlog.audit({ title: 'vendor.internalId', details: vendor.internalId });
Also, try running the script without setting an itemvendor sublist record, and see what happens.Stephen Elms
09/27/2020, 3:04 PM{"ITEM":{"sku":"SKU #1","catalogcode":"1804","summary":"Billiard Table","details":"Billiard Table","price":9999.99}, "VENDOR":"1648", "SUBSIDIARY":{"internalId":"3","externalId":"","type":"subsidiary"} }
I'm getting the following error:
"Drop ship/Special order items must have a preferred vendor and purchase price."
Peferred vendor and purchase price are specified, so there must be something wrong with the way I'm setting/creating the itemvendor sublist?
My code now looks like:tdietrich
09/27/2020, 3:14 PMlog.audit({ title: 'itemRecord', details: itemRecord });
That might shed some light on what values have (and have not) been set.Stephen Elms
09/27/2020, 8:49 PMtdietrich
09/27/2020, 9:57 PMStephen Elms
10/03/2020, 2:41 PM