Script for dynamic update of sum field