-
How can I add a lookup relationship using an external id on a before insert/update trigger in Salesforce?
I would like to create a lookup relationship to a parent object using the parents external id from a before insert/update trigger. I am not receiving an error when I do this, but it is not creating the relationship. I have tested using anonymous apex with a dml and the code works fine. In the example, Tech1_ID__c is the external id of the Property__c object.
trigger CaseAddressHandler on Case (before insert, before update) {
for(Case c: trigger.new){
c.Property__r = new Property__c(Tech1_ID__c =c.Property_Id__c);
}
}
Log In to reply.
Popular Salesforce Blogs
Salesforce Health Cloud Implementation: Complete Guide for Healthcare Providers
Healthcare organizations face mounting pressure to improve patient engagement while managing complex data systems. According to a 2024 global survey, nearly 40 percent of healthcare…
Get Access Token From Google Calendar API Through Postman | Salesforce Developer Guide
Get Access token from Google Calendar API through Postman While working with integration with third parties, it is very very important to get the access…
Dreamforce 2023 Key Highlights | The Ultimate Guide
On September 12, 2023, the realms of technology and business once again united for the year’s highly anticipated event – Dreamforce 2023. Over 40,000 individuals…
Popular Salesforce Videos
Marketing Cloud | Salesforce Send Email
There are two ways to send an email in Marketing Cloud; Guided Send Wizard & Salesforce Send Email. The benefit of the Salesforce Send Email…
What is a Salesforce PDO Partner?
Salesforce market is growing very fast these years. It is estimated that in 2021 the Salesforce ecosystem will be worth around 100 billion U.S. dollars.…
Product Rule Vs Price Rule Salesforce CPQ
Product Rule CPQ product rules help ensure sales reps are putting together the right products and bundles every single time. You don’t have to worry…