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
Dwayne TaylorDwayne Taylor 

Conditional field update with conditions on not in picklist

Hi everyone,

New to Salesforce and learning quickly but hit a formula logic wall which I hope someone can assist me with.

I have a formula I am trying to build to monitor status changes by users.

We have a global list (Owner: Website and Status: Dropped Off) which our sales team move their leads into based on the restatus of a lead to "Dropped Off" in the event they go into long term nuturing based, this status then triggers a change of assigned user to a gloabl user "Website".

In the event that the lead then makes an enquiry through the website these leads, enquiries are then distributed on a round robin but the owner will stay as Website as the status will still be Dropped Off but it does a trigger of changing the owner to the Enquiry owner then back to website as the status is still "Dropped Off". 

I want to monitor when a sales consultant moves a lead into this list, take a static snapshot of the owner but not update this field when the status is being changed by this global "Website" user AND the current status is "Dropped Off".

Current workflow rule
ISCHANGED(Contacts_Status__c)

Attempted:
  • ISCHANGED(Contacts_Status__c) AND( Owner.FirstName <> 'Web',  Contacts_Status__c  <> 'Dropped Off')
    • Error: Syntax error. Extra AND
  • AND( ISCHANGED(Contacts_Status__c) , Owner.FirstName <> 'Web',  Contacts_Status__c  <> 'Dropped Off') 
    • Error: Field Contacts_Status__c is a picklist field. Picklist fields are only supported in certain functions. Tell me more
Thoughts?
Best Answer chosen by Dwayne Taylor
Andy BoettcherAndy Boettcher
Gotcha.  Try this:
 
AND(
     ISCHANGED(Contacts_Status__c),
     NOT(Owner.FirstName = 'Web'),
     NOT(TEXT(Contacts_Status__c) = 'Dropped Off')
)

All Answers

Andy BoettcherAndy Boettcher
Wrap your picklist field in the TEXT() function.
Dwayne TaylorDwayne Taylor
Thanks for the response Techman97, Do you mean like this? AND( ISCHANGED(TEXT(Contacts_Status__c)) , Owner.FirstName 'Dropped Off') Getting - Error: Incorrect argument type for function 'ISCHANGED()'. Cheers Dwayne
Andy BoettcherAndy Boettcher
Is this a workflow or validation rule?
Dwayne TaylorDwayne Taylor
Hi techman97, This is a workflow formula which has a field update task connect to it. So the formula which I am wanting to build will determine if the fields will be updated or not. Dwayne
Andy BoettcherAndy Boettcher
Gotcha.  Try this:
 
AND(
     ISCHANGED(Contacts_Status__c),
     NOT(Owner.FirstName = 'Web'),
     NOT(TEXT(Contacts_Status__c) = 'Dropped Off')
)
This was selected as the best answer
Dwayne TaylorDwayne Taylor
Thanks Andy!
Looks like this works and makes alot more sense now looking at it
Andy BoettcherAndy Boettcher
Just as a best practice followup, when you build criteria, the most executionally efficient comparison variable is "Equals".  You can leverage system functions like NOT() to reverse the criteria.  Makes it really clean and easy to read too.  =)