Hi everyone, I’ve created a custom field in the Price Level subtab of the Item record using the following code in a user event:
"var sublist = form.getSublist({
id: 'price'
});
var priceLevelVal = newRecord.getValue({
fieldId: 'custitem_price_level_cost'
});
var priceLevelObj = JSON.parse(priceLevelVal);
log.debug('Price Level Object', priceLevelObj);
var newFldd = sublist.addField({
id: 'custpage_cost_field',
type: serverWidget.FieldType.TEXT,
label: 'Item Cost'
});
newFldd.updateDisplayType({
displayType: serverWidget.FieldDisplayType.ENTRY
});"
I’m trying to set a value in the field using the following code:
"sublist.setSublistValue({
id: 'custpage_cost_field',
line: 0,
value: 'test'
});"
But the value is not being populated in the field. What am I doing wrong in the code?