3
votes

To perform SubmitFields onto standard Netsuite Records (i.e. Purchase Orders) it is something like this:

    var poId = context.key; 

    var id = record.submitFields({
        type: record.Type.PURCHASE_ORDER,
        id: poId,
        values: {
            custbody_someField: someValue
        },
        options: {
            enableSourcing: false,
            ignoreMandatoryFields : true
        }
    });

What is the type field for Custom Records? I tried the ID of the Custom Record, but it doesn't work: e.g.

type: record.Type.customrecord_my_record_id
2

2 Answers

4
votes

I don't know what the 'official' answer is. The fake enum types don't have any custom record references that I was able to find. Setting the type to the string that is the id of the custom record works for me. (No record.Type. prefix though)

... type: "customrecord_my_record_id", ...

1
votes

That is true that the references are only for standard record types. You can alternatively get all enums into a variable and log it using

var recordTypesEnums = Object.keys(record.Type);
//you may log recordTypesEnums array