You need to sign in to do that
Don't have an account?
Formula is not working???
Hi, this is the first portion of my formula that updates a sales region field based on states and distribution channel. When I run it, it updates all of the commercial channel accounts with the first IF statement value of "Commercial Central/West" I can't figure out why it isn't reading or looking at the other if statements. I didn't get any limitation or syntax errors when I created it.
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "AK:AZ:CA:CO:HI:ID:MT:NV:NM:OR:UT:WA:WY")), "Commercial Central/West",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "ND:SD:MN:WI:MO")), "Commercial North Central",
IF(ISPICKVAL(Channel__c, "Commercial") && NOT(CONTAINS(ShippingState, "TX,AR,LA,OK")), "Commercial TALO",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "NE:KY:KS:MI:IA:IL:IN:OH")), "Commercial Midwest",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "ME:CT:DE:FL:MD:MA:WV:NH:NJ:NY:PA:RI:VT:VA:DC")), "Commercial East",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "NC:SC")), "Commercial NC/SC",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "TN:GA:AL:MS")), "Commercial South East",
IF(ISPICKVAL(Channel__c, "Forensics") && NOT(CONTAINS(ShippingState,
Hi JaxBeach,
Just try this formula ,i used contains instead of NOT(Contains())
You can modified the out put value if the shipping state contains the Specified value.
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "AK:AZ:CA:CO:HI:ID:MT:NV:NM:OR:UT:WA:WY",ShippingState),"Commercial Central/West ",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "ND:SD:MN:WI:MO",ShippingState ) , "Commercial North Central",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "TX:AR:LA:OK",ShippingState ) , "Commercial TALO",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "NE:KY:KS:MI:IA:IL:IN:OH",ShippingState), "Commercial Midwest",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "ME:CT:DE:FL:MD:MA:WV:NH:NJ:NY:PA:RI:VT:VA:DC",ShippingState ), "Commercial East",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "NC:SC",ShippingState ), "Commercial NC/SC",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "TN:GA:AL:MS", ShippingState ), "Commercial South East",NULL)))))))
All Answers
I thought that too, but when I don't include the not, it just updates the field with a blank value. The formula was written with help from developer community. The rest of the formula contains regions for Domestic, Government and Forensics channels and they all update correctly.
Hi JaxBeach,
Just try this formula ,i used contains instead of NOT(Contains())
You can modified the out put value if the shipping state contains the Specified value.
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "AK:AZ:CA:CO:HI:ID:MT:NV:NM:OR:UT:WA:WY",ShippingState),"Commercial Central/West ",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "ND:SD:MN:WI:MO",ShippingState ) , "Commercial North Central",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "TX:AR:LA:OK",ShippingState ) , "Commercial TALO",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "NE:KY:KS:MI:IA:IL:IN:OH",ShippingState), "Commercial Midwest",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "ME:CT:DE:FL:MD:MA:WV:NH:NJ:NY:PA:RI:VT:VA:DC",ShippingState ), "Commercial East",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "NC:SC",ShippingState ), "Commercial NC/SC",
IF (ISPICKVAL(Channel__c , "Commercial")&& CONTAINS ( "TN:GA:AL:MS", ShippingState ), "Commercial South East",NULL)))))))
I had tried this before and it didn't work, but with your solution you moved shippingstate to after the states listed and now it is working - thanks so much!