0

I have a custom object which draws an External ID field from its Parent. I created a Formula Field to pull that data in to the custom field. However, I want to use that field on the custom object as an External ID for the the custom object... but can't because of the limitation that formula field caanot be an external id. Is there another way I can accomplish this?

2
  • 1
    This sounds like a bit of an X-Y problem as is. Can you explain what you're trying to do with this external Id field? It's possible that you may be better served by a parent-child subquery. – Derek F Jun 24 '20 at 20:42
  • I want to upsert records from an external Database to this custom object in Salesforce. This Custom object has a master detail relationship with Account. On Account is the ExternalId field, that i want to use to get the records from the external database. – GroundToCloud Jun 24 '20 at 21:12
3
String externalId = 'SOMETHING';

ChildObject__c childObject = new ChildObject();
childObject.Account__r = new Account(ExternalId__c = externalId);

insert childObject;

You don't need the external Id on the child record.

EDIT: Relevant documentation

0

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.