@jen - create normal client script record in UI - on script record you can specify function name for each client script function type (saverecord, validateline etc.). Of course name of the function in script needs to match the one you provided in UI. Last thing - refference client script in code by using form.setScript