You need to sign in to do that
Don't have an account?
Phillip Moseley
Trying to Include Multiple Profile Names in Validation Rule Formula - No Errors, but Rule Not Working
Here is the fomula that I have now. I'm trying to include multiple profile names in the formula so the validation rule error will appear for all profiles. I've gotten it to work if I just have one profile name listed, but I need to account for all the profile names in my example formula below.
IF(AND($Profile.Name == "Field Sales - MD 7132010 - Comm AE,Field Sales - MD 7132010,Field Sales - Higher Ed,Field Sales - Commercial East,Inside Sales", BMXQ__Proposal_Template__r.Name == "LEGAL 1. Order Form: New Customer"),true,false)
Thanks,
IF(AND($Profile.Name == "Field Sales - MD 7132010 - Comm AE,Field Sales - MD 7132010,Field Sales - Higher Ed,Field Sales - Commercial East,Inside Sales", BMXQ__Proposal_Template__r.Name == "LEGAL 1. Order Form: New Customer"),true,false)
Thanks,
IF(AND($Profile.Name == "Field Sales - MD 7132010 - Comm AE",
$Profile.Name == "Field Sales - MD 7132010,Field Sales - Higher Ed",
$Profile.Name == "Field Sales - Commercial East,Inside Sales",
BMXQ__Proposal_Template__r.Name == "LEGAL 1. Order Form: New Customer"),true,false).
If this answers your question make this as a solution please.
I'm also not sure you need the double "=" in declarative formulas.
Here is an example of a validation that works for me:
AND(
ISBLANK( Corp_CompanyID__c ),
RecordType.Name = "Corporate Account"
)
Why don't you try:
AND($Profile.Name = "Field Sales - MD 7132010 - Comm AE",
$Profile.Name = "Field Sales - MD 7132010,Field Sales - Higher Ed",
$Profile.Name = "Field Sales - Commercial East,Inside Sales",
BMXQ__Proposal_Template__r.Name = "LEGAL 1. Order Form: New Customer")
I believe you requirement might be this.
why I kept all profiles in Or condition is the logged user will under one profile.
At a time he can not fall into more than one profile and the AND condition for all profiles may not satisfy.
If this answers your question make this as a solution please.
AND(OR($Profile.Name = "Field Sales - MD 7132010 - Comm AE",
$Profile.Name = "Field Sales - MD 7132010,Field Sales - Higher Ed",
$Profile.Name = "Field Sales - Commercial East,Inside Sales"),
BMXQ__Proposal_Template__r.Name = "LEGAL 1. Order Form: New Customer")
Suree was right to put the OR in there, i missed that. it wouldn't be possible to have all 3 of the profiles at once.
Is this validation on the Parent object of the Order Form object? The __r suggests that it is looking to see if there are any templates with that name, not just the one you are saving, related to the record you are saving.
If that's right, then wouldn't it be best to have the validation on the BMXQ__Proposal_Template__c object with something like this:
AND(OR($Profile.Name = "Field Sales - MD 7132010 - Comm AE",
$Profile.Name = "Field Sales - MD 7132010,Field Sales - Higher Ed",
$Profile.Name = "Field Sales - Commercial East,Inside Sales"),
Name = "LEGAL 1. Order Form: New Customer")