TransWikia.com

Change owner in process builder from set of values

Salesforce Asked on December 14, 2021

Could you please help me out on this requirement.
getting an error: The formula expression is invalid: Syntax error. Missing ‘)’

I have a process builder where it should change the owner when the status field value is changed from Rejected to New and the Country should be any of list and should consider if there are any zip codes that starts with some numbers. I tried a formula but getting the error.

AND
(ISPICKVAL(PRIORVALUE([Lead].Status), "Rejected") ,
ISPICKVAL([Lead].Status, "New"),
ISCHANGED([Lead].Status),
AND(OR
   (
ISPICKVAL([Lead].State , "North Carolina"),
ISPICKVAL([Lead].State, "South Carolina"),
ISPICKVAL([Lead].State, "Georgia"),
ISPICKVAL([Lead].State, "Florida"),
ISPICKVAL([Lead].State, "Alabama"),
ISPICKVAL([Lead].State, "Tennessee"),
     ))
AND(OR(BEGINS([Lead].PostalCode , 50) ,
                BEGINS([Lead].PostalCode , 56)
   )
)
)

One Answer

You're missing a comma, for starters. Secondly, the latter two ANDs are superfluous. Also, the last two "numbers" are still strings, and need to be in quotes.

AND(
    ISPICKVAL(PRIORVALUE([Lead].Status), "Rejected"),
    ISPICKVAL([Lead].Status, "New"),
    ISCHANGED([Lead].Status),
    OR(
        ISPICKVAL([Lead].State , "North Carolina"),
        ISPICKVAL([Lead].State, "South Carolina"),
        ISPICKVAL([Lead].State, "Georgia"),
        ISPICKVAL([Lead].State, "Florida"),
        ISPICKVAL([Lead].State, "Alabama"),
        ISPICKVAL([Lead].State, "Tennessee"),
    ),
    OR(
        BEGINS([Lead].PostalCode , "50"),
        BEGINS([Lead].PostalCode , "56")
    )
)

Answered by sfdcfox on December 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP