2

When you mark a Contact as primary while adding it as Opportunity contact role in Lightning, It allows to save even without assigning a role to the primary Contact. When we try the same thing in Classic, the error message comes up and does not allow to save.

How we can bring the same functionality in Lightning?

2 Answers 2

4

I don't think there's much you can do here, as per the usual with Opportunity Contact Role. Since there's no triggers or validation rules on that object, you don't have any real-time chance to intervene in the transaction.

You're stuck then with either (a) Scheduled Apex to locate and remedy those records; or (b) observing in real time with Change Data Capture, which does support OpportunityContactRole.

The only route I can see, and it's a tricky one, would be a component on the Lightning record page for Opportunity that listens for change data capture events for Contact Roles on its own Opportunity. It could then post a Toast message, open a modal, or even set a flag on the Opportunity itself to prevent it from saving. But that's a lot of work (with pre-release technology!) and it wouldn't buy you a guarantee of data integrity since it's purely reactive in the UI layer.

Lots of good Idea Exchange posts to vote up on Opportunity Contact Roles, although I don't see this specific one among them:

1
  • Thanks for your answer. I have raised a case with salesforce about it. I will update soon. Commented Jan 10, 2019 at 17:06
0

Now you can write validation rules and triggers on OpportunityContactRole object. Just write a validation rule to prevent the users to add a new contact role.

1
  • From which release is that feature available - please include that in your answer.
    – Dave Humm
    Commented Sep 25, 2020 at 13:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .