0

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 : only caseowner has 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.

  • Security settings as Read wouldn't fulfill your purpose? Or do you require explicitly to cover this scenario by using validation rules? – Alexander Aeons Torn May 23 '17 at 12:37
  • Mini Pane Window? validation rule or trigger fire for all events you can't control it for Mini Pane Window only. – Avijit Chakraborty May 23 '17 at 13:26
1

Try this in the validation rule:

OwnerId <> $User.Id 
  • 2
    Why would you AND a single clause? Just remove that function! – Adrian Larson May 23 '17 at 12:52
  • @AdrianLarson: You are right! Modified the validation rule. – Kamruzzaman May 23 '17 at 13:25
0

Try to use the below validation rule:

IF( $User.Id <> OwnerId , True, False)

Hopefully this will work.

  • 1
    You can always replace IF(condition, true, false) with just condition. – Adrian Larson May 23 '17 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.