+ Start a Discussion

Insert Custom Setting

I am trying to insert a custom setting for a user as such


MySetting__c x = new MySetting__c(); x.name = 'blfd'; x.setupOwnerId = UserInfo.getUserId(); insert(x);


 The error I get is "System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: SetupOwnerId (id value of incorrect type): [SetupOwnerId]"


what is the data type for setupOwnerId ?