-
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
What are Field Dependencies in Salesforce in 2023? | All You Need to Know
Salesforce is a powerful CRM platform that allows businesses to customize and tailor the software to their specific needs. One of the ways this is…
Salesforce Data Loss: Is Your Data Correct? How Can UI Contribute?
For a number of years security and safety of data has been the major reason which proved itself to be a hiccup in the path…
Data Management in Salesforce - Here is All You Need to Know
This is the important part to understand clearly as an administrator. In this blog we are going to learn about how the data is imported…
Popular Salesforce Videos
Write Tableau CRM Data to Salesforce Objects
Use Tableau to blend Salesforce data from across the Customer 360 platform with your other business data for increased visibility and a deeper understanding of…
Object Oriented Programming - Salesforce Developer Tutorial
In relation to programming languages, object-oriented means that the code focuses on describing objects. An object can be anything that has unique characteristics, such as…
Explain Standard Business Features of Salesforce?
Standard business features of Salesforce are Contact Management, Opportunity Management, Lead Management, Quote Management, Sales Management and Sales Forecasting. Watch the video to learn all…