Guest User

Untitled

a guest
Feb 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Account acc = new Account(Name='Test Name');
  2. if (acc.Do_Not_Contact__pc == false) {
  3. System.debug('DNC is false');
  4. } else {
  5. System.debug('DNC is true');
  6. }
  7. insert acc;
  8. acc.Do_Not_Contact__pc = true;
  9. update acc;
  10.  
  11. System.DmlException: Update failed. First exception on row 0 with id 001W000000fFiVbIAK; first error: INVALID_FIELD_FOR_INSERT_UPDATE, Account: bad field names on insert/update call: Do_Not_Contact__pc: [Do_Not_Contact__pc]
  12.  
  13. acc.Do_Not_Contact__pc = 'true';
  14.  
  15. acc.Do_Not_Contact__pc = true;
  16.  
  17. acc.Do_Not_Contact__c = true;
Add Comment
Please, Sign In to add comment