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
imishraimishra 

Opportunity and Opportunity Line Items

Hi,
I have a scenario, where i have 2 users 'a'&'b' with same profile.
For user 'a' i have a validation rule to stop any modifications in the opportunity details section once it is saved.
But the user must have the access to add the line items once added to the opportunity team.
If i add 'a' in an opportunity team and give him read/write access, when he tries to modify any field, the validation rule is triggered and gets an error.
But the validation rule prevents the user from adding the line items also.

Is there any way we can keep the validation rule only for the opportunity details, not for any related list objects.

My validation rule is 
AND( Id <> null, $User.Horizontal_User__c == true).

Its very urgent.

Any help is appreciated.

Thanks.
Best Answer chosen by imishra
Boom B OpFocusBoom B OpFocus
Hi imishra,

The work around is to create a roll-up summary in the Opportunity that rolls up the count of Opportuntiy Line Items.  Then add that new field to the validation rule like this:

AND( Id <> null, $User.Horizontal_User__c == true, NOT(ISCHANGED(OLI_Rollup__c)))

Good Luck.

All Answers

Boom B OpFocusBoom B OpFocus
Hi imishra,

The work around is to create a roll-up summary in the Opportunity that rolls up the count of Opportuntiy Line Items.  Then add that new field to the validation rule like this:

AND( Id <> null, $User.Horizontal_User__c == true, NOT(ISCHANGED(OLI_Rollup__c)))

Good Luck.

This was selected as the best answer
imishraimishra
It worked..
Thanks..