-
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
Introducing Junction Objects in Salesforce
A Junction is an object which is utilized to combine two master-detail relationships. In a layman’s dialect, when two relationships come together, they shape one…
Optimize Customer Support Services With Salesforce Service Cloud Implementation
The power to make or break a brand rests solely with the customers today. With ever-evolving customer needs, preferences, and expectations, businesses explicitly focus on…
Unlocking the Power of Salesforce for Insurance Agency Management
Agency management is an essential part of the insurance industry, as it involves managing the relationships between insurance companies and their agents. This includes tasks…
Popular Salesforce Videos
Power of Personal Brand | The Shrey Sharma Show | Salesforce
Shrey is a Chief Executive Officer at Cyntexa, a SILVER Salesforce Consulting Partner in the USA, UK, UAE, Australia, Singapore & India, having a vibrant…
Coronavirus Impact On Healthcare Sector – Time To Rejuvenate | Salesforce CRM
The Covid 19 has created an economic recession in the healthcare industry with disruption in healthcare services. The global healthcare CRM market is likely to…
Tips for Importing Data in Salesforce
Data can be easily imported into Salesforce through various tools provided by Salesforce. Supported data sources include any program that can save data in the…