You need to sign in to do that
Don't have an account?
Adding a record type to a formula
Can someone help me figure out the right "grammar" for the following? I need to create this formula only for one record type. I have tried several formats without any success.
Thanks.
AND(
IF(
CASE( StageName , "Stage to be Required 1", 1, "Budgetary Quote Presented", 1, "Application Submitted", 1, "Application Completed", 1, "Quote/Prodef Completed", 1, "Samples Approved/Accepted", 1, "Customer Visit to FOBA", 1, "Finalizing Product Specifications", 1, "Negotiation/Review", 1, "Won Order, PO Pending", 1, "Closed Lost", 1, "Closed Won", 1, "Project on Hold", 1, "Project Identified and Qualified", 1, 0))
($RecordType.Id "01250000000DcDc",1,0))
Well, for all of you that have been following this discussion, here is the solution:
IF (NOT(RecordTypeId="01250000000DcDc"), 0, CASE( StageName , "Stage to be Required 1", 1, "Budgetary Quote Presented", 1, "Application Submitted", 1,
"Application Completed", 1, "Quote/Prodef Completed", 1, "Samples Approved/Accepted", 1,
"Finalizing Product Specifications", 1, "Negotiation/Review", 1, "Won Order, PO Pending", 1,
"Closed Lost", 1, "Closed Won", 1, "Project on Hold", 1, "Project Identified and Qualified", 1, 0))
This is a custom formula field which is part ofan app on the appexchange that ensures that at least one primary contact role is added to an Opportunity.
Thanks everyone for your input.
All Answers
You should be okay with
RecordTypeId ="01250000000DcDc"
Thanks for your response. But, still having a problem. I am using this for the solution you gave me to download Opportunity Primary Contact Rule from Appexchange. Any idea on what I am doing wrong? It gives me an error message that the field RecordType ID does not exist :
AND(
IF(
CASE( StageName , "Stage to be Required 1", 1, "Budgetary Quote Presented", 1, "Application Submitted", 1, "Application Completed", 1, "Quote/Prodef Completed", 1, "Samples Approved/Accepted", 1, "Customer Visit to FOBA", 1, "Finalizing Product Specifications", 1, "Negotiation/Review", 1, "Won Order, PO Pending", 1, "Closed Lost", 1, "Closed Won", 1, "Project on Hold", 1, "Project Identified and Qualified", 1, 0),
RecordType.Id =" 01250000000DcDc "))
It is the Contact Required field (formula)from the Opportunity object. Is below not correct? It says I am missing a ")" but when I add, it gives me an error: "Incorrect number of parameters for function IF(). Expected 3, received 2". It does not see to like the AND(IF(
AND(
IF(
CASE( StageName , "Stage to be Required 1", 1, "Budgetary Quote Presented", 1, "Application Submitted", 1, "Application Completed", 1, "Quote/Prodef Completed", 1, "Samples Approved/Accepted", 1, "Customer Visit to FOBA", 1, "Finalizing Product Specifications", 1, "Negotiation/Review", 1, "Won Order, PO Pending", 1, "Closed Lost", 1, "Closed Won", 1, "Project on Hold", 1, "Project Identified and Qualified", 1, 0),
RecordTypeId =" 01250000000DcDc ")
AND( IF( CASE( StageName , "Stage to be Required 1", 1, "Budgetary Quote Presented", 1, "Application Submitted", 1, "Application Completed", 1, "Quote/Prodef Completed", 1, "Samples Approved/Accepted", 1, "Customer Visit to FOBA", 1, "Finalizing Product Specifications", 1, "Negotiation/Review", 1, "Won Order, PO Pending", 1, "Closed Lost", 1, "Closed Won", 1, "Project on Hold", 1, "Project Identified and Qualified", 1, 0), RecordTypeId =" 01250000000DcDc "))
Here is a RecordTypeID formula that I used to require a Contact Type for a specific Contact Record Type (if the Account is a Client)
AND (ISPICKVAL(Account.Type, "Client"), (RecordTypeId ="012345678912345"), (Active__c = TRUE), NOT(ISPICKVAL(Contact_Type__c, "IT")), NOT(ISPICKVAL(Contact_Type__c , "Marketing")), NOT(ISPICKVAL(Contact_Type__c , "Procurement")), NOT(ISPICKVAL(Contact_Type__c , "Inactive")), NOT(ISPICKVAL(Contact_Type__c , "Billing")), NOT(ISPICKVAL(Contact_Type__c , "Executive")))
Yes, tried something similar but got: Error: Incorrect parameter for function AND(). Expected Boolean, received Number. Sometimes formulas drive me CRAZY:smileymad:
AND( (RecordTypeId =" 01250000000DcDc "), CASE( StageName , "Stage to be Required 1", 1, "Budgetary Quote Presented", 1, "Application Submitted", 1, "Application Completed", 1, "Quote/Prodef Completed", 1, "Samples Approved/Accepted", 1, "Customer Visit to FOBA", 1, "Finalizing Product Specifications", 1, "Negotiation/Review", 1, "Won Order, PO Pending", 1, "Closed Lost", 1, "Closed Won", 1, "Project on Hold", 1, "Project Identified and Qualified", 1, 0))
Try removing the spaces that you have at the start and end of the record type ID
In other words, use
(RecordTypeId ="01250000000DcDc"), instead of (RecordTypeId =" 01250000000DcDc "),
and see whether that resolves the issue.
I think you have the syntax wrong on your AND statement. What is it you trying to achieve with this formula? It may be easier to help you if you describe in fine detail what you want your result to be and where it will be used(display a value or for field validation) and to use some psuedo code when describing the formula.
Happy Monday!
I recommend where possible to use $RecordType.Name as the formula will then port between your PROD and Sandbox instance.
Example from one of my apps: IF($RecordType.Name = 'Discount', Extended_Price__c * (-1.00), Extended_Price__c )
Well, for all of you that have been following this discussion, here is the solution:
IF (NOT(RecordTypeId="01250000000DcDc"), 0, CASE( StageName , "Stage to be Required 1", 1, "Budgetary Quote Presented", 1, "Application Submitted", 1,
"Application Completed", 1, "Quote/Prodef Completed", 1, "Samples Approved/Accepted", 1,
"Finalizing Product Specifications", 1, "Negotiation/Review", 1, "Won Order, PO Pending", 1,
"Closed Lost", 1, "Closed Won", 1, "Project on Hold", 1, "Project Identified and Qualified", 1, 0))
This is a custom formula field which is part ofan app on the appexchange that ensures that at least one primary contact role is added to an Opportunity.
Thanks everyone for your input.