How to prevent leaving the record if the portal record did not meet certain requirement

Discussion created by jameshoty on Apr 10, 2013
Latest reply on Apr 11, 2013 by Stephen Huston

A Stock table is 1-to-many related to Stock Material table (typical relationship setup).

Screen Shot 2013-04-10 at 10.25.59PM.png


The purpose of Stock_Material_Total_Weight TO is so that I can display the total weight of all the material for a Stock item

Screen Shot 2013-04-10 at 10.29.30PM.png


The requirement is that the total weight of all the material for the same stock must be exactly 100. The user can freely modify any material BUT can not leave this master record (either by going to the next previous record, jumping to another layout etc) if the total wieght is not 100.


I have a script to detect the total weight and have trial and error various ways but not successful. I tried layout setup, portal setup, also script trigger for the field etc.