Show Hyper Link On Add Error in Salesforce Trigger


Requirement: Check Duplicate record in system and show the add error in form of hyperlink corresponding duplicate record ID

Solution:

Write a trigger and show add error

objExistingRecord >>> OldRecord Id
objNewRecord >> New Record 

objNewRecord.addError('Same Combination of Record already Inserted in System: <a href=\'/'+ objExistingRecord.id +'\'>'+objExistingRecord.Name+'</a>', false);

                      
                                                   Thanks
                                               Sumit Shukla


Comments

Popular posts from this blog

Salesforce Spring 16 Release Exam (Maintenance Exam Q&A) for Developer 201 Admin

Show the Success Message before Redirecting the Detail page on Visualforce Page