+ Start a Discussion
Alexandra StehmanAlexandra Stehman 

Including Custom Settings values in validation errors?

I wanted to enforce a minimum price on an item and am managing it as a custom setting.  I have a validation rule checking it, but the text of the validation rule is not properly substituting the text of the custom setting variable reference.

Is this even possible?
Best Answer chosen by Alexandra Stehman
Avijit Chakraborty 11Avijit Chakraborty 11
Ok understand use trigger 

All Answers

Avijit Chakraborty 11Avijit Chakraborty 11
Please help me out with an example I have used Vlookup with customsetting in validation rule withoput any isse 
Alexandra StehmanAlexandra Stehman

Sorry, I misspoke - the text of the "Error Message" associated with the validation rule appears it cannot reference a custom setting, like


" The minimum monthly fee for that product is $Setup.Price_Limits__c.Min_Fee__c."

Avijit Chakraborty 11Avijit Chakraborty 11
Valudation rule is not applicabe on custom settins 
Alexandra StehmanAlexandra Stehman
No, no... I am not trying to validate the custom setting itself.

The custom setting holds the price minimums for specific products.

I am comparing the sale price of particular OpportunityProducts (line items) to values set in the custom setting - within a validation rule on OpportunityProduct.

I just want to be able to report back to the user, within the error message displayed WHEN these validations fail, WHAT those minimums are (from the values in the custom settings).

The goal is to flexibly set minimums without the need to modify validation rules - only custom settings.

Avijit Chakraborty 11Avijit Chakraborty 11
Ok understand use trigger 
This was selected as the best answer