-
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
How Digital Adoption Platforms for Salesforce Enable Digital Transformation
As technology is advancing, it has become important for organizations to adopt the latest, state-of-the-art software systems. However, these software systems are only good if…
Preparation for Unplanned Downtime in Salesforce
Get Ready for Impromptu Downtime As a framework blackout is more a matter of when as opposed to in the event that, IT and business…
Salesforce Deployment Using Gearset: All You Need to Know
What is Gearset? Gearset is the complete DevOps solution. More quickly and easily than ever before, we assist teams in comparing, moving, and tracking changes between…
Popular Salesforce Videos
What is Salesforce | Salesforce CRM Tutorial For Beginners | Salesforce Training
This Salesforce Training Video will help you understand what is a CRM ( Customer Relationship Management ), why we need Salesforce CRM and how some…
How Link Cartridge Development Can Your Business Storefront | Salesforce Link Cartridge
LINK Cartridge is a container for packaging and deploying program code and data, it’s structured in folders and subfolders for maximum efficiency.
myTrailhead Product Filters | Salesforce Tutorial Video
Salesforce myTrailhead has now released their next update in product filters. You can now create your own product filters that are relevant to your business…