+ Start a Discussion
VirijaVirija 

How to Prevent Inactive Contacts from appearing in the Opportunity Contact Role Selection

Hi,

 

I have a custom field Called "Active" on the Contact object. Users in our organization will "Uncheck" the Active Check box if they feel that the contact is no longer valid. 

 

Now a user creates an opportunity and tries to add Opportunity Contact roles and by default salesforce will display all the contacts that are under the Account from which the opportunity is created. Users sometimes will add Inactive contacts as an opportunity contcats role. 

 

1. Is there any way to prevent the Inactive contacts from appearing at the Opportunity Contact role (Something similar to a Lookup filter) so hat the user will not have an option to add inactive contact as the contact role?

 

2. If the aboove is not possible, can I wriite a trigger on Opportunity contact role object to throw an error when a user tries to add Inactive Contact as a contact role?

 

Thank You in advance for your help.

ForceComForceCom

Hi, 

 

You can add filters to a lookup from the set up menu.

 

Thanks,

Dharani

 

VirijaVirija

Hi Dharani,

 

Thank you for the reply. To my knowledge, I don't think we can use lookup filters to filter the contact records appearing in opportunity contact roles. Can you please let me know the stpes to add filters on opportunity contact roles?

ForceComForceCom

Hi, 

 

https://success.salesforce.com/ideaView?id=08730000000Bq9gAAC

 

There is an idea on this. 

 

As a short term fix , you can write a trigger on contact role , such that when they create a contact role(when the record is saved ) for an inactive user , it gives an error . 

 


Thanks,

Dharani