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
sainath .chalamcherlasainath .chalamcherla 

validation rule on caseobject

Hi Team.

I am new bie to salesforce,I am in baffle state whether to go with validation rule or code fix for this scenario.
Validation Rule scenario:
Criteria : caseowner has the rights to "EDIT" the case(In Mini Pane Window).
Analysis : I am the user, I created a case, my name should display on "CaseOwner" field of case object and i can only "edit" (In Mini Pane Window).the case.
                 If any user try to edit the case,Message should display.
                 If the user "Accepts" the case then "caseowner" field should populate with user name and he has rights to "edit" (In Mini Pane             Window)the case.            
Message : Please accept the case inorder to "Edit".

My workarrounds:
 1 ) IF( ISCHANGED( LastModifiedById ) && (OwnerId <> $User.Id) && (OwnerId <> LastModifiedById) && (LastModifiedById <> $User.Id), true,false) -- Notworking
2) AND( ISCHANGED( OwnerId ), (OwnerId <> Owner:User.Id)) --Notworking
3) IF( ISCHANGED(  Owner:User.Id  ) && (OwnerId <> $User.Id) && (OwnerId <> LastModifiedById) && (LastModifiedById <> $User.Id), true,false)--Error ---The ISCHANGED function cannot reference the Owner:User.Id field.


Thanks
sainath.

 
Maharajan CMaharajan C
Hi Sainath,

You can simply use $User.Id <> OwnerId to solve the issue what you have.

Otherwise you have to try like this OR(AND(( PRIORVALUE( OwnerId ) <>  OwnerId ),($User.Id <> OwnerId)),($User.Id <> OwnerId))

Can you please Let me know if it works or not!!!

If it works mark this as a best answer!!!

Thanks,
​Raj