Thursday 3 December 2015

Workaround for COMPILE ERROR: Field is not writeable: Account.IsPartner

As part of my requirement, I had to create an account making isPartner as true, Unfortunately I got this  COMPILE ERROR: Field is not writable: Account.IsPartner 



Then I first inserted that account then updated isPartner as true.


Account acc = new Account(name = 'Asish');
insert acc;
System.debug('Inserted account Ispartner ---'+acc.Ispartner);
acc.Ispartner = true;
update acc;
System.debug('Inserted account---'+acc);

For more info on Ispartner field--  https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_account.htm

No comments: