When creating a customer, I can't set the entityid...
# suitescript
d
When creating a customer, I can't set the entityid via
record.setValue("entityid", customer.entityId);
It just doesn't update. So I save the record, then reload the record and save the entityid field explicitly but it throws what seems like an unrelated error.
\"name\":\"YOU_CANNOT_DELETE_PRIMARY_CURRENCY\",\"message\":\"You cannot delete the primary currency.\"
Copy code
let upsertRecord = isUpdate ? 
            this.netsuiteService.updateRecord(existingRecord, <any>customerRecord) :
            this.netsuiteService.createRecord(RecordType.CUSTOMER, <any>customerRecord);        
            upsertRecord = this.netsuiteService.upsertAddresses(upsertRecord, addressRecordList);
        
        customerId = upsertRecord.save();
        if (!isUpdate) {
            const customerRecord = this.netsuiteService.loadRecord(RecordType.CUSTOMER, customerId);
            customerRecord.setValue("entityid", customer.entityId);
            customerRecord.save();
        }
Any ideas what this could be?