function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
motumotu 

Rule to Ensure One Contact required for an Account Record?

Is there any way that I can set up an Account validation rule to ensure that one Contact record is created for an Account if Type equals Prospect or Customer?  I actually wanted to create an Opportunity validation rule to ensure that there is one contact for the related Account of the Opportunity.  I could not see a way.
Steve :-/Steve :-/
There's an Opportunity Primary Contact Rule available from Salesforce Labs for free on the AppExchange.  I've implemented it here, and tweaked the triggers a little bit.  You *might* be able to hack it up, and bastardize it to work at the Account level.  
motumotu

Thank you. I downloaded this app, made the mods and it worked like a charm.  Only problem is that I need to use this only for one record type.  I tried to add the record type to the formula using IF but I am doing something wrong.  Any idea what?  Here is what I have:

 

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, "Open", 1, "Won Order, PO Pending", 1, "Closed Lost", 1, "Closed Won", 1, "Project on Hold", 1, "Project Identified and Qualified", 1, 0)

IF($RecordType.Id "01250000000DcDc",1,0)

hhuiehhuie

Think it should be:

 

IF($RecordType.Id = "01250000000DcDc",1,0)

or


IF(RecordTypeId =  "01250000000DcDc",1,0)

Message Edited by hhuie on 03-26-2009 12:29 PM
motumotu

No go:

 

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) IF($RecordType.Id = "01250000000DcDc",1,0)

 

rpr2rpr2

Try this:

 

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"

 

motumotu

I tried but go this message (Note that without the record type section, the formula works):

 

Error: Incorrect parameter for function and(). Expected Boolean, received Number

 

 

hhuiehhuie
Looks like you're going to have to change the 1's into True and the 0's into False