You need to sign in to do that
Don't have an account?
Christophe Lucchini
validation rule field
Hi Everyone !
I want to make a validation rule on the object "Opportunity", the rule is basically :
We want to check the Stage of the opportunity , if the opp is in stage = Negotiation / Verbal / Contract / Launched / Invoiced / Closed , and the field "agent" (Sales_Agent__c) is different from "None (Sales Agent)" and the field "Agent_Commission__c" is blank and the field "Agent_Commission_Amount_Manual__c" is blank.
So if all this is gathered, an error message is displayed:"Please check the agent commissions. ..."
So in order to do that , i have created a validation rule , like this:
AND(
OR(
text(StageName) = "Negotiation",
text(StageName) = "Verbal",
text(StageName) = "Contract",
text(StageName) = "Launched",
text(StageName) = "Invoiced",
text(StageName) = "Closed",
OR(
ISBLANK( Agent_Commission__c )
,
Sales_Agent__c<>"None (Sales Agent)"
,
ISBLANK(Agent_Commission_Amount_Manual__c)))
But i have an issue , when we apply the validation rule , even if the field "Agent" is equal to "None (Sales Agent)" the rule still applies.
Thanks for your help !
I want to make a validation rule on the object "Opportunity", the rule is basically :
We want to check the Stage of the opportunity , if the opp is in stage = Negotiation / Verbal / Contract / Launched / Invoiced / Closed , and the field "agent" (Sales_Agent__c) is different from "None (Sales Agent)" and the field "Agent_Commission__c" is blank and the field "Agent_Commission_Amount_Manual__c" is blank.
So if all this is gathered, an error message is displayed:"Please check the agent commissions. ..."
So in order to do that , i have created a validation rule , like this:
AND(
OR(
text(StageName) = "Negotiation",
text(StageName) = "Verbal",
text(StageName) = "Contract",
text(StageName) = "Launched",
text(StageName) = "Invoiced",
text(StageName) = "Closed",
OR(
ISBLANK( Agent_Commission__c )
,
Sales_Agent__c<>"None (Sales Agent)"
,
ISBLANK(Agent_Commission_Amount_Manual__c)))
But i have an issue , when we apply the validation rule , even if the field "Agent" is equal to "None (Sales Agent)" the rule still applies.
Thanks for your help !
Here we go, try this:
Hope this helps and if it solves the issue then mark it as Best Answer!
All Answers
As you mentioned you want both "Agent_Commission__c" should be blank and the field "agent" (Sales_Agent__c) is different from "None (Sales Agent)".
So, you need to provide AND condition between these two.
AND(
OR(
text(StageName) = "Negotiation",
text(StageName) = "Verbal",
text(StageName) = "Contract",
text(StageName) = "Launched",
text(StageName) = "Invoiced",
text(StageName) = "Closed",
),
ISBLANK( Agent_Commission__c ),
Sales_Agent__c<>"None (Sales Agent)",
ISBLANK(Agent_Commission_Amount_Manual__c))
If my understanding is correct, then it should work. Check this and let me know.
I tried the code but when i change the Subsegment (New) , i still have the error message.
If it solves the issue, mark it as best answer!
Sorry its not working with this code :
This is giving me the following error with "Sales_Agent__c":
Error: Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Lookup(Account)
Sales_Agent__TEXT__c = TEXT( Sales_Agent__c.Name ) - anything that fetching that full name.
Once done, try to reference this formula into our original formula. The end result would look somehting like below,
Hope this helps!
Sales_Agent__TEXT__c = Sales_Agent__c
Because you can't put TEXT() with a lookup field.
So i get the ID of the agent from "Sales_Agent__c", wich is for "None" = "0011000000mV2Cc".
So i put this formula:
But it's not working, its like the part :
"text(StageName) = "Negotiation", text(StageName) = "Verbal", text(StageName) = "Contract", text(StageName) = "Launched", text(StageName) = "Invoiced", text(StageName) = "Closed", "
is Passing in front of the rest of the formula ?
Here we go,
Try to set it up and see if it helps.
And its ok on the opportunity :
But when i put the formula :
it's not working , in this example the field "Agent" is "None (Sales Agent)" / the field "Agent_Commission__c" is blank / the field "Agent_Commission_Amount_Manual__c" is blank and the "Stage" is "Contract" but i have th error message when i try to change the Segment:
But with the Field ""Agent" is "None (Sales Agent)" , logically i don't have error message.
Thanks for your help !
Agent_Commission__c is blank OR zero (0)?
Agent_Commission_Amount_Manual__c is blank OR zero (0)?
Try this if that is the case,
also make sure there is no double space or any obvious issue in TEXT fields..
I don't understand why its not working, no space or anything else in TEXT fields.
1) that agent TEXT field criteria matches which is "None (Sales Agent)"
2) Both of the comission field is null
3) I am not sure about the STAGE but it maybe either one of these: Negotiation, Verbal, Contract, Launched, Invoiced, Closed
I am not sure what is not working?!
1)The agent text field have to be different from "None (Sales Agent)".
2)Both of the comission field are Blank/null
3)The stage have to be one of the following : Negotiation, Verbal, Contract, Launched, Invoiced, Closed
In the exemple condition 2 and 3 are ok but the 1 not because the field is "None (Sales Agent)".
Thanks !
Here we go, try this:
Hope this helps and if it solves the issue then mark it as Best Answer!