AnsweredAssumed Answered

Validation in portal against parent TO

Question asked by HammerOz on Feb 11, 2016
Latest reply on Feb 11, 2016 by DavidJondreau

Hi there,

 

I have a parent table (Production). The child table is (Grades). I am entering % of production for each grade in a portal. So how to best ensure the total percent of all grades is not more than 100%?

 

  • Parent production table has a calculated field cGradePercTotal  which his the sum of the child grades %.
  • A calculated validation for the grade field Grade_Percent that references the parent Production  If(Sum(PROD::cGradePercTot)<100;1;0)
  • A script trigger commits records after each grade % is updated (on object modify)

 

Result

When the portal first goes over 100% the validation doesn't kick in even when I change Production records. I then change the % of a grade so the total is back under 100% and the validation error kicks. I cant change % of grade to a lower value. It has to be deleted. I am watching If(Sum(PROD::cGradePercTot)<100;1;0) in the data viewer and it is providing the right boolean result.

 

I thought validation by the field was most robust or should I script validation? Thank you!!

Outcomes