I've been trying to add the Currency data under the Financial Tab for a vendor while creating a new vendor via suite script, Every single attempt results in different errors, but I somehow reduced it to
Please enter value(s) for: Currency
pasting a sample of my code - I set the currency value right before the commitline method.
rec.selectNewLine({
sublistId: "currency",
line: 1,
});
log.debug("Record data here :", rec);
var currencies = getCurrenciesInformation();//all currency information available in NS account
if (!isNullOrEmpty(currencies)) {
for (var key2 in currencies) {
if (!isNullOrEmpty(currencies[key2])) {
//set the sublist data values.
log.debug("iterated currency value:", key2);
log.debug("iterated currencies[key2] value:", currencies[key2]);
rec.setCurrentSublistValue({
sublistId: "currency",
fieldId: key2,
value: currencies[key2].id,
});
rec.commitLine({
sublistId: "currency",
});
log.debug("Record data here :", rec);
}
}
}
I'm trying to get a successful response from the vendor created, with all the currencies under the Financial Tab.