Ask Search:
Luciano CastroLuciano Castro 

change lead status if moving from queue to user

I am trying to create a workflow when a lead is changed from a queue to a user, I would like to change the status of the lead. 

I am trying this formula as a criteria  but it does not work 

AND(
ISCHANGED(OwnerId),
LEFT(PRIORVALUE(OwnerId),3 ="00G"))

Error: Error: Incorrect parameter type for operator '='. Expected Number, received Text

Note: I have 20 different queues so I am trying not to add each queue ID. There must be way since queue share the same first 3 characters



 
Best Answer chosen by Luciano Castro
Amit SinghAmit Singh
@Luciano,

What if you are changing the Owner From Queue to Queue then Validation Rule should not be fired but the above will execute. To exclude that case I put the Last Line and using that Validation Rule It will only execute when the Owner Will be changed from Queue to user, not from User to user

All Answers

Amnon KruviAmnon Kruvi
Try:

AND(
ISCHANGED(OwnerId),
LEFT(PRIORVALUE(OwnerId),3) ="00G")
Amit SinghAmit Singh
Like This
AND(
	ISCHANGED(OwnerId),
	LEFT(PRIORVALUE(OwnerId), 3)="00G",
    LEFT(OwnerId,3)='005'
)

 
Luciano CastroLuciano Castro
@Amnon Kruvi

Cant believe I missed the parenthesis :) 

@Amit Singh - I dont think the last line applies to me. I do not want the status to change if is change from user to user
Amnon KruviAmnon Kruvi
Whether you've been doing this for 1 year, or 15 years, we all forget parenthesis every now and again.
Amit SinghAmit Singh
@Luciano,

What if you are changing the Owner From Queue to Queue then Validation Rule should not be fired but the above will execute. To exclude that case I put the Last Line and using that Validation Rule It will only execute when the Owner Will be changed from Queue to user, not from User to user
This was selected as the best answer
Luciano CastroLuciano Castro
@Amit 
That was good. I did not think of that. This will make sure we have all our ends covered.
I appreciate both of you for helping me out. 
Amit SinghAmit Singh
Cheers :)
Luciano CastroLuciano Castro
Guys, I need your help again. We were doing some testing and I am not sure if I need to create another workflow or not but this came up. 

If we are changing from inactive user to an active user, the workflow should fire. Where should I place this requirement into this workflow

AND( 
ISCHANGED(OwnerId), 
LEFT(PRIORVALUE(OwnerId), 3)="00G", 
LEFT(OwnerId,3)='005' 
)
Luciano CastroLuciano Castro
In another words, 
The worfklow should fire if: 
Changing from Queue to User
Changing from Inactive User to User