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
Ratish Kumar 13Ratish Kumar 13 

Data type mismatch issue while inserting into Custom object from Big object

Hi All,
While inserting data into Custom object from Big object using Async SOQL getting error "Data type of selected field doesn't match data type of target field".

Like to know whether there is any way to insert text field of Big object into Email field of Custom Object without doing type casting or writing any Apex code for the same.

 
NagendraNagendra (Salesforce Developers) 
Hi Ratish,

When defining the targetFieldMapparameter, make sure that the field type mappings are consistent. If the source and target fields don’t match, then follow the below consideration.
  • If a field in the query result is mapped more than once, even if mapped to different fields in the target object, only the last mapping is used.
Sometimes, the query executes successfully but encounters an error while attempting to write the results to the target object. Because of the volume of data involved, capturing every error is inefficient. Instead, subsets of the errors generated are captured and made available.

Those errors are captured in the BackgroundOperationResult object and retained for seven days. You can query this object with the Async SOQL query jobID to filter the errors for the specific Async SOQL query. 

To insert text fields of big objects into email field of custom objects then you need to go with type casting or apex.

Also, refer to below blog post on more information. Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra