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
CalvinHobbesCalvinHobbes 

Read only access for Queue records

How do we prevent user from editing a lead which is in queue without accepting it?

 

I did a validation rule to check:

 owner not equal to queueid

 and

 Last modified date is changed.

 

This din't work and i could save the edited queue record while the owner was queue.

 

Any help would be great!

sebcossebcos

Hi,

the validation rule needs to find the error condition to prevent from saving.

You have to ask yourself : when should i stop from saving? In your case when the owner is not a user but a queue.

The first part of your validation rule :

"owner not equal to queueid" is true only when the record is not owned by the queue.

I have tried this rule that checks that the owner is not the current user:

$User.Id <> OwnerId.

If I have not accepted the record from the queue (the owner of the record is not me), I cannot modify the record.

Remember that this validation rule could annoy the users who try to edit the record wihtout accepting it and other users who have access to the record but are not the owner.

You need to give the user a good validation error message so they understand what they have done wrong.

Training for your end users is also recommended before introducing those changes in the process.

 

CalvinHobbesCalvinHobbes

Hey Sebcos,

 

Thank you for responding.

 

1. I need to do it only for Queue records, i.e. i would be checking userid against the queue id.

2. I need to check if any item/field on the record is updated? in case it is, don't save the record.

 

This is what i tried:

 

AND(

Ownerid = Queueid,

ISCHANED(LastModifiedDate)

)

 

This din't work. I want to avoid having all the fields checked for ischanged.

Need more simpler and better approch.  any ideas?

sebcossebcos

Hi,

I respond to your points:

 

1. you can do it but you have to use the id (not the name) of the queue like so:

 

OwnerId = '00G4000000190ja' && NOT(ISCHANGED(OwnerId) )

 

Please note that I had to copy the queue id (you will have to do the same in your org and use your own queue id) and had to check if ownerid is not changed otherwise the validation rule will always fail when trying to accept the record. 


2. you don't need to check if any item/field is changed; the validation rule will be fired everytime any field/item is changed.

RevJoelRevJoel

I am attempting to do the same thing. After tweaking that code and adding my own queue ID, it does not work. No errors are thrown. Here is what is in my validation rule:

 

AND(
OwnerId = '00G50000001Pkc8' && NOT(ISCHANGED(OwnerId) )
)

 

Thanks, Sebcos!