You need to sign in to do that
Don't have an account?
Alexander G Goodman
Conditional validation using Visualforce
I am try to make a vaildation rule that kicks in on the Opportunity object, if a field in Opportunity Product object meets certain critia. The field is a date field. Firstly is this possable with Visualforce? and if so how as I have no experience with Visualforce.
Go to Your name => Setup => Customize => Opportunity => Validation Rules
For more details you go to the below link
http://help.salesforce.com/apex/HTViewHelpDoc?id=fields_defining_field_validation_rules.htm
So my question is can I create a Cross object validation rule with a 1 to many lookup relationship (which will trigger on the opportunities object based on critia in the Opportunity Products Object) using either Date Field or Text Field were the rule kickes in this the field is blank?
Secondly If you have a page where user is trying to insert Opportunity as well as Opportunity products both at the same time (that is possible only using vf page) then only you can show validation error.
Validation you can check in the controller of the page.
Let me know for further queries
So when a date field is empty in Opportunity Products it stops the related opportunity from closing and I can't make the field in Opportunity Products required.
You can do this using trigger only. let me know if this helps
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_trigger.htm
http://salesforce.stackexchange.com/questions/25320/how-to-write-a-trigger-on-opportunity
https://developer.salesforce.com/forums/ForumsMain?id=906F00000009FplIAE