-
How to compare Trigger.new values with Trigger.old values
I have a junction object 'Related Products' which has master detail relationship with 'Contact' and have a lookup relationship with 'Product'. And I have added a related list of 'Related Products' in Contact detail page where user can create new Related Product from the Contact and can add multiple Products to it.
Now my requirment is "if any user selects a product which is already selected to that contact should through error".
For example, I have contact called "Test Contact111", In it I have created one Related Product "RP-0001" and selected a Product called "Prod111", It will get to save and will show in the Contact's detail page under 'Related Products' section.
Again from the same Contact I will create another Related Product "RP-0002" and again will select the Same Product "Prod111", now the trigger need to throw an error states "Prod111 is already selected"
Log In to reply.
Popular Salesforce Blogs
Success Stories – How DemandBlue Helped Its Clients Improve Revenue Recognition with Salesforce Revenue Cloud Implementation
Businesses that deal with subscription-based contracts, usage-based billing or other complex contracts face several difficulties in managing their billing cycle. Though Salesforce CPQ implementation does the heavy-lifting…
How to Integrate Salesforce With Social Media Channels
More than 60% of the world now uses social media and has active profiles on more than six social media platforms. Social networks have long…
Comparing Salesforce Orgs Since 2015: How BOFC Helped Define Metadata Management Before It Was a Category
Every Salesforce Admin eventually runs into the same question: two orgs, and no reliable way to know what's actually different between them. A sandbox drifts…
Popular Salesforce Videos
Security in Salesforce | Learn About the Security Levels in Salesforce
This "???????? ?? ??????????" video by Edureka will help you understand the different levels of security in Salesforce. It will also talk about some 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…
How to Download Backup Files from Salesforce Using UIPath Robots
How to download backup files from Salesforce using UiPath robots. How to get the latest file from the folder: Directory.GetFiles(“YOUR FOLDER”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).First The link…