I’m trying to create Custom Item Field programmati...
# suitescript
g
I’m trying to create Custom Item Field programmatically (I know its not officially supported but I’m soooo close …) and having issue with MULTISELECT type because I can’t register the recordtype to be used:
Copy code
let cf = record.create({type: 'itemcustomfield', isDynamic: true});
cf.setValue({fieldId: 'label', value: 'TEST TEST 2'});
cf.setValue({fieldId: 'scriptid', value: 'custitem_test_test2'});
cf.setValue({fieldId: 'itemmatrix', value: true});
cf.setValue({fieldId: 'fieldtype', value: 'MULTISELECT'});
cf.setValue({fieldId: 'selectrecordtype', value: 738});
cf.save();
When setting selectrecordtype (becasue isDynamic is set), I get: > parent.checkRecordType is not a function if I change the fieldtype to simple ones (checkbox/…) I’m able to save it. The problem is just when MULTISELECT is used as I need to define the List/Record value