You need to sign in to do that
Don't have an account?
Brianna Bollettieri
Workflow Rule - Opportunity Naming Convention
HI! So I created a workflow rule for an opportunity naming convention and I want to tweak it a little but I've been having some trouble doing so. Here is the worklow rule criteria:
AND(IF(ISNEW() || ISCHANGED(AccountId), true, false), OR(RecordType.Name = 'Leviton Mexico Opportunity'
, RecordType.Name = 'International Opportunity'
)
)
Then I have the following action which is a field update (opportunity name):
IF(
ISNEW() || ISNULL(AccountId),
IF(
ISBLANK(AccountId),
TEXT(End_User__c),
Account.Name
) + " : " +
Name + " : " +
Project_BU__c,
IF(
AND(
ISCHANGED(AccountId),
NOT(ISBLANK(AccountId)),
ISBLANK(PRIORVALUE(AccountId))
),
SUBSTITUTE(Name, TEXT(End_User__c), Account.Name),
Name
)
)
So right now what happens is that it searches for the account name (end-user), if it is blank it temporarily adds the word End-User as a place holder. What I wanted to change is that I want it to search for the account name (end-user) then if that is blank I want it to search for the distributor and use that. But if both are blank, then I want it to add End-User as a filler. Hope that makes sense and hope someone can assist! Thanks!
AND(IF(ISNEW() || ISCHANGED(AccountId), true, false), OR(RecordType.Name = 'Leviton Mexico Opportunity'
, RecordType.Name = 'International Opportunity'
)
)
Then I have the following action which is a field update (opportunity name):
IF(
ISNEW() || ISNULL(AccountId),
IF(
ISBLANK(AccountId),
TEXT(End_User__c),
Account.Name
) + " : " +
Name + " : " +
Project_BU__c,
IF(
AND(
ISCHANGED(AccountId),
NOT(ISBLANK(AccountId)),
ISBLANK(PRIORVALUE(AccountId))
),
SUBSTITUTE(Name, TEXT(End_User__c), Account.Name),
Name
)
)
So right now what happens is that it searches for the account name (end-user), if it is blank it temporarily adds the word End-User as a place holder. What I wanted to change is that I want it to search for the account name (end-user) then if that is blank I want it to search for the distributor and use that. But if both are blank, then I want it to add End-User as a filler. Hope that makes sense and hope someone can assist! Thanks!
IF(
OR(
ISNEW(),
ISNULL(AccountId)
),
IF(
ISBLANK(AccountId),
IF(
ISBLANK(Distributor__r.Name),
TEXT(End_User__c),
Distributer__r.Name
),
Account.Name
) + " : " + Name + " : " + Project_BU__c,
IF(
AND(
ISCHANGED(AccountId),
NOT(ISBLANK(AccountId)),
ISBLANK(PRIORVALUE(AccountId))
),
SUBSTITUTE(Name, TEXT(End_User__c), Account.Name),
Name
)
)
All Answers
Try something like this. You can simply add the check on the related distibutor where you would originally set the filler name in the event of no related account. This way there is a second check for the distibutor before setting the name. Adjustments are necessary since i dont have the API name for the related distibutor object but more on cross object formulas can be found here (https://help.salesforce.com/HTViewHelpDoc?id=fields_creating_cross_object_notes.htm).
IF(
OR(
ISNEW(),
ISNULL(AccountId)
),
IF(
ISBLANK(AccountId),
/*TEXT(End_User__c),*/
/* Replace this with another IF block to check name on distributor*/
IF(
ISBLANK(Distributor__r),
TEXT(End_User__c),
),
Account.Name
) + " : " +
Name + " : " +
Project_BU__c,
IF(
AND(
ISCHANGED(AccountId),
NOT(ISBLANK(AccountId)),
ISBLANK(PRIORVALUE(AccountId))
),
SUBSTITUTE(Name, TEXT(End_User__c), Account.Name),
Name
)
)
Hope this helps!
AM
IF(
OR(
ISNEW(),
ISNULL(AccountId)
),
IF(
ISBLANK(AccountId),
(TEXT(End_User__c)),
),
IF(
ISBLANK(Distributor__r.Name),
TEXT(End_User__c),
),
Account.Name
) + " : " +
Name + " : " +
Project_BU__c,
IF(
AND(
ISCHANGED(AccountId),
NOT(ISBLANK(AccountId)),
ISBLANK(PRIORVALUE(AccountId))
),
SUBSTITUTE(Name, TEXT(End_User__c), Account.Name),
Name
)
)
IF(
OR(
ISNEW(),
ISNULL(AccountId)
),
IF(
ISBLANK(AccountId),
/*TEXT(End_User__c),*/
/* Replace this with another IF block to check name on distributor*/
IF(
ISBLANK(Distributor__r.Name),
TEXT(End_User__c),
Distributer__r.Name
),
Account.Name
) + " : " +
Name + " : " +
Project_BU__c,
IF(
AND(
ISCHANGED(AccountId),
NOT(ISBLANK(AccountId)),
ISBLANK(PRIORVALUE(AccountId))
),
SUBSTITUTE(Name, TEXT(End_User__c), Account.Name),
Name
)
)
IF(
OR(
ISNEW(),
ISNULL(AccountId)
),
IF(
ISBLANK(AccountId),
TEXT((End_User__c)),
Account.Name
),
IF(
ISBLANK(Distributor__r.Name),
TEXT(End_User__c),
Distributor__r.Name
),
Account.Name
) + " : " +
Name + " : " +
Project_BU__c,
IF(
AND(
ISCHANGED(AccountId),
NOT(ISBLANK(AccountId)),
ISBLANK(PRIORVALUE(AccountId))
),
SUBSTITUTE(Name, TEXT(End_User__c), Account.Name),
Name
)
)
IF(
OR(
ISNEW(),
ISNULL(AccountId)
),
IF(
ISBLANK(AccountId),
IF(
ISBLANK(Distributor__r.Name),
TEXT(End_User__c),
Distributer__r.Name
),
Account.Name
) + " : " + Name + " : " + Project_BU__c,
IF(
AND(
ISCHANGED(AccountId),
NOT(ISBLANK(AccountId)),
ISBLANK(PRIORVALUE(AccountId))
),
SUBSTITUTE(Name, TEXT(End_User__c), Account.Name),
Name
)
)