You need to sign in to do that
Don't have an account?

Validation Rule to Fire on Parent Object verifying the Child Object field values
Hi,
I have a requirement to create a validation rule to fire on the parent object field change by checking the value for the child object field.
For Example:
Parent Object Picklist Field Name = Stage
Child Object Field Name = Premium
Need a Validation rule to fire whenever the picklist value " Stage" is changed to "Bound", the value on the field "Premium" should be greater than Zero before the parent record is saved.
Is it possible through Validation rules? Or is there any other way?
Thanks
I have a requirement to create a validation rule to fire on the parent object field change by checking the value for the child object field.
For Example:
Parent Object Picklist Field Name = Stage
Child Object Field Name = Premium
Need a Validation rule to fire whenever the picklist value " Stage" is changed to "Bound", the value on the field "Premium" should be greater than Zero before the parent record is saved.
Is it possible through Validation rules? Or is there any other way?
Thanks
Great..! Here you go:
Go to the Parent Object and create a Rollup summary field label it Check_Premiuim__c(you can name it as you like it)
Then, Click Next
Now, the Summarized Object: Select the Child Object
Select Rollup Type: COUNT
From Filter Criteria, select Only records meeting certain criteria should be included in the calculation
Filter: Premium(Your Child object field) greater than 0
Click Save
Now, setup your validation rule on parent object....it goes like this -->>
AND(ISCHANGED( Stage ), ISPICKVAL( Stage , "Bound"),Check_Premiuim__c<=0 )
(Here Stage is your Parent picklist field name and Check_Premiuim__c is the rollup summary field you just created).
Be sure to use proper API names, the best way to do it is use Insert Field button.
Please, let me know if this helps..!!
All Answers
This could not be possible using Validation Rules. You have to write trigger for it.
Regards
Amrender
What type of Trigger I need to Write? "After trigger" on Parent Object? Do you have any example to post here . Thank you
It is possible through validation rule if you have an master detail relationship.
Is the relationship between your objects master-detail relationship??
If yes, then you can achieve it by validation rule.
Let me know if its master detail.
Great..! Here you go:
Go to the Parent Object and create a Rollup summary field label it Check_Premiuim__c(you can name it as you like it)
Then, Click Next
Now, the Summarized Object: Select the Child Object
Select Rollup Type: COUNT
From Filter Criteria, select Only records meeting certain criteria should be included in the calculation
Filter: Premium(Your Child object field) greater than 0
Click Save
Now, setup your validation rule on parent object....it goes like this -->>
AND(ISCHANGED( Stage ), ISPICKVAL( Stage , "Bound"),Check_Premiuim__c<=0 )
(Here Stage is your Parent picklist field name and Check_Premiuim__c is the rollup summary field you just created).
Be sure to use proper API names, the best way to do it is use Insert Field button.
Please, let me know if this helps..!!
Thanks for the help!!