function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pushkar GauravPushkar Gaurav 

System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Campaign__c]: [Campaign__c]

Best Answer chosen by Pushkar Gaurav
ravi soniravi soni
hi pusjkar,
you need to fill out this field while inserting your object.
E.g => Contact con = new Contact();
            con.firstname = 'test';//Optional filed
            con.lastname = 'myName';//this is required field
insret con;
if you forget to putting lastname then you will get REQUIRED_FIELD_MISSING error.

In nutshell, I will say that fill out Campaign__c field when you are inserting object.

don't forget to mark it as best answer.
I'm waiting for your response.


Thank you

 

All Answers

ravi soniravi soni
hi pusjkar,
you need to fill out this field while inserting your object.
E.g => Contact con = new Contact();
            con.firstname = 'test';//Optional filed
            con.lastname = 'myName';//this is required field
insret con;
if you forget to putting lastname then you will get REQUIRED_FIELD_MISSING error.

In nutshell, I will say that fill out Campaign__c field when you are inserting object.

don't forget to mark it as best answer.
I'm waiting for your response.


Thank you

 
This was selected as the best answer
Pushkar GauravPushkar Gaurav
how to set up value of a field named Campaign( data type: Lookup(Campaign) ) ?