2

fields:"Include_in_Oppty_Rollup__c"

message:"Include: value not of required type: "

statusCode:"INVALID_TYPE_ON_FIELD_IN_RECORD"

Include_in_Oppty_Rollup__c is a checkbox on my object.

I keep getting this error when I try to use this code:

estimate.fieldsToNull.Include_in_Oppty_Rollup__c=(val) ? 'TRUE' : 'FALSE';

This should set my value for Include_in_Oppty_Rollup__c field.

Has anyone faced the same issue?

3

Probably it is throwing that error because you are using 'True' and 'False'. Those values are of type String. Remove the '' to use Boolean instead of String.

Try this: estimate.fieldsToNull.Include_in_Oppty_Rollup__c=(val) ? true : false;

0

I know this answer is a bit late, but simply said you may get this error for the following reasons.

  1. you are inserting the wrong data value into the field of interest.
  2. You are referencing a field from a relationship field, but that relationship field is null, so the result is null, and that field might not support null values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.