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
Jeevana Priyanka BJeevana Priyanka B 

On changing the Owner filed from Queue to user it should the status of a custom object

On changing the Owner filed from Queue to user it should the status of a custom object.

I am using the process builder with the below formula
AND(

ISCHANGED([Custon_Object].OwnerId),

OR(
[Custon_Object].OwnerId = $User.Id,
AND( LEFT(PRIORVALUE([Custon_Object].OwnerId),3) = '00G', LEFT([Custon_Object].OwnerId,3) = '005' )
)

)

I am getting the following error while activating it.
Your changes are saved, but you can't activate this process until you resolve the following errors.
The formula expression is invalid: Formula result is data type (Boolean), incompatible with expected data type (Text).
The formula expression is invalid: Formula result is data type (Boolean), incompatible with expected data type (Text).

Please help, Thank you in advance
 
Raj VakatiRaj Vakati
Use this one
 
AND(
ISCHANGED([Custon_Object].OwnerId),
OR(
[Custon_Object].OwnerId = $User.Id,
AND( LEFT(PRIORVALUE([Custon_Object].OwnerId),3) == '00G', LEFT([Custon_Object].OwnerId,3) == '005' )
)

)

 
Raj VakatiRaj Vakati
AND(
ISCHANGED([Custon_Object].OwnerId),
OR(
[Custon_Object].OwnerId = $User.Id,
AND( LEFT(PRIORVALUE([Custon_Object].OwnerId),3) == '00G', LEFT([Custon_Object].OwnerId,3) == '005' )
)

)