-
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
Compare Salesforce Profiles Easily with BOFC
Why Compare Profiles in Salesforce? Salesforce Profiles define user permissions, field-level access, object-level access, and system privileges. When you manage multiple profiles (like Sales, Service,…
‘The Killers’, And What’s Not Killing At Salesforce Connections ’18!
Salesforce Connections 2018 is just around the corner and we are as excited as you guys are! “The Killers” are coming to rock the event…
Power up Your Digital Store with DemandBlue’s Salesforce B2B Commerce Implementation
Today, digitalization has become a norm for business practices, and there is nothing better you can do to support your digital business model than implementing…
Popular Salesforce Videos
Kizzy Consulting Salesforce Services - Grow Your Business 2X With Salesforce CRM
Kizzy Consulting is a Salesforce Ridge Consulting Partner in the USA and has successfully implemented 100+ Salesforce projects for 100+ clients across sectors like Financial Services,…
Create Targeted Campaigns w/ Marketing Cloud Advertising | Salesforce Demo
Explore the power of using 1st party data to power ad audiences across the most popular ad channels today, including Google (Search, Shopping, YouTube, Gmail),…
Kizzy Consulting - Top Salesforce Partner Intro Video
Kizzy Consulting is a Salesforce Consulting Partner and has successfully implemented 100+ Salesforce projects for 100+ clients across sectors like Financial Services, Insurance, Retail, Sales, Manufacturing,…