Hi All. I'm having trouble updating the entity fie...
# suitescript
j
Hi All. I'm having trouble updating the entity field in a purchase order. I get a suitescripterror - "requireMap: {prefix: undefined, name: "_@r6", parentMap: undefined, unnormalized: false, url: "_@r6.js", …}", "requireType: "require" In the following example, i'm trying to set the vendor entity to a known vender - "'vendor X" . Any thoughts on why i get this error. I can even try to set it to the value from the record via "getValue and that fails.
var poRecord = record.load({
type: record.Type.PURCHASE_ORDER,
id: poInternalId
});
var poEntityName = poRecord.getValue ({
fieldId: 'entity'
});
var po = poRecord.setValue ({
fieldId: 'entity',
value: 'vendor X'
});
var savedRec = poRecord.save({
ignoreMandatoryFields: true
});
s
you need to set the internal id for the
entity
field value
e.g. the primary key for 'vendor x' not a string name
that said, the error sounds perhaps more like a module system issue
j
@stalbert Thanks for your comments. When i look at the value that i get from the existing PO, it is an internal id. If i try to set it with that internal id, i still get the error. I think i've tried every possible combination of values... What do you mean by module system issue? I think that this code actually worked at one time, so i'm really confused (and ready for friday happy hour!). Thanks!