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
RajeevKumarRajeevKumar 

Getting error when try to update RecordType field using Patner API

Errors were found on item 0
Error code is: INVALID_FIELD
Error message: The external foreign key reference does not reference a valid entity: RecordType

How to fix, please help.
SuperfellSuperfell
for all foreignKey fields you need to set the Id field to the salesforce.com ID of the related record. (unless you want to use externalIds, but i don't think you do).

So set the RecordTypeId field, and for your lead generator question, set the lead_xxx__c field to the ID of the related custom object.
RajeevKumarRajeevKumar
Thanks for reply. Record type worked fine. How to find ID for custom fields.
Please help.
SuperfellSuperfell
if you created a custom lookup field, the field itself is the id field (e..g if your custom field is foo__c, then set foo__c to the related Id.
RajeevKumarRajeevKumar
I found ID for custom field , I was passing wrong value. Lead_Generator_Last_Name__c
Thanks very much for your great help.