-
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
Salesforce Mobile App Development: Integrating Third-Party Apps and Services
Introduction Productivity while on the road is essential in today's hectic work environment. In order to empower its users, Salesforce, a top customer relationship management…
Develop in Production: Insane or Inspired?
Accelerating implementation We all know the benefits of accelerating and streamlining the release cycle; the business is more agile and reduced development effort. But there…
Salesforce Trends to Look Out for in 2021
Salesforce is one of the top Customer Relationship Management (CRM) platforms. It helps businesses to connect with customers and potential clients by using cloud technology.…
Popular Salesforce Videos
Configuration Attribute In Salesforce CPQ | Salesforce Development Tutorial | Learn Salesforce Series by Algoworks
Configuration attributes can be used in setting up the value of multiple shared product option fields simultaneously in Salesforce CPQ. In this Salesforce tutorial, you…
Pardot Marketing Automation Tools Overview Webinar
Are you looking to take your Salesforce Marketing Automation to the next level? Learn how to build successful lead nurturing campaigns that empower your sales team…
Salesforce Consultant Certifications - Large Data and Transaction Volumes
As you already aware, expertise in Salesforce is in huge demand. The Salesforce Certifications are industry-recognized and are a proof of your skill/expertise in Salesforce.…