Skip to main content

Hi

 

 

I have a custom field that applies a specific sku to an opportunity based on the Opportunity Name.  It is something like this:

 

 

if(contains ("OppName 1", Name),"sku1",

 

if(contains ("OppName 2", Name),"sku2",

 

if(contains ("OppName 3", Name),"sku3", "unknown")))

 

 

This had been working fine - but we realized that we had to more easily differntiate between Opportunities (so that there wasn't 500 version of an Opp Name across accounts) and have since applied an Opportunity Name field update/workflow to name the Opportunity something like "AccounName OppName 1 (Sept 2014)".  Here is the formula to do this:

 

 

Account.Name

 

& " " &

 

Related_Asset__r.Name

 

& " "

 

CASE(MONTH(Related_Asset__r.Maintenance_End_Date__c),

 

2, "February",

 

3, "March",

 

4, "April",

 

5, "May",

 

6, "June",

 

7, "July",

 

8, "August",

 

9, "September",

 

10, "October",

 

11, "November",

 

12, "December",

 

1, "January",

 

"0")

 

& " " &

 

TEXT(YEAR (Related_Asset__r.Maintenance_End_Date__c))

 

& ")"

 

 

This formula works perfectly for renaming the opportunities.

 

 

Problem

 

 

After changing the Opp Name formula by implementing the workflow, our sku formula field is not working properly - it is just returning "unknown" for everything.

I thought that contains() would evaluate the entire name field and return the desired sku result, even if the Opp Name didn't start/finish with the text in the sku formula.

 

 

Any thoughts on how to get around this??
8 respuestas
  1. 8 sept 2014, 3:18
    If just tested this on my Dev SFDC org and it worked fine:

     

    Datatype: Formula 

     

    Result: Text 

     

    Formula: 

     

    IF(CONTAINS( Name , "Sales"), "SKU-SALES",

    IF(CONTAINS( Name , "Quota"), "SKU-QUOTA",

    "SKU-Other"))

     

    give this a shot

     

    IF(CONTAINS( Name , "OppName 1"), "SKU-1",

    IF(CONTAINS( Name , "OppName 2"), "SKU-2",

    IF(CONTAINS( Name , "OppName 3"), "SKU-3",

    "Unknown")))

0/9000