function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
chowdary marellachowdary marella 

Urgent Help..!!!

Hi all.i created 2 users(A,B), "A" as system admin and other "B" as Standard User, i created OWD setting as private for lead. so "B" cannot see Lead records.

Requirement: if suppose lead in "A" with email as "S@gmail.com"

WHEN LEAD "B" Tries to create a record with email as "S@gmail.com"(same as already existed). i need to show an popup as "LEAD ALREADY EXISTS. you want to see the lead??"aLSO i need to show the already existed lead reecord("S@gmail.com").this popup and showing the record will happen after click on save.

I think i need create a trigger that shows popup message if email already exists.next i need to create a vf page that shows the already existed record (same email is record). can any one help me how to design.?? because iam not sure how to display the record after save with existing email

How a particular record with already email record will come after click on save , but owd is private. need to show after click on save only after email matches.

 

Thanks

 

Bhawani SharmaBhawani Sharma
You cannot open a popup from Trigger. Trigger only handles pre and post processing of dml operations. But you can create a HTML error message from trigger, where you can click on error message and that will open the lead record in a popup window. Your popup should be a VF page and associated controller will run in without sharing mode.
Noam.dganiNoam.dgani

1.create a text field on lead - "hidden email" (dont put it in the layout)

2.Set the unique attribute of the field to TRUE (case insesitive).

3.create a workflow on the lead object:

      3.1 Every time a record is created or edited.

      3.2 Copy the value of Email field to "Hidden Email" field

 

Let SF do the rest.

 

chowdary marellachowdary marella
My biggest Bet is. How can i show lead record, when The OWD of LEAD is
Private??? i think i need to use lead.share in apex
please let me know if you got anything\


Thanks in advance