Configured Event onActionPerformed Script Run NamedQuery

Consider also refactoring your code like this, to dramatically reduce duplication (and opportunities for typos to slip in):

def runAction(self, event):
    path = 'Refrigeration/ChillerWOEntry'
    params = {
        "chillerID": self.parent.custom.ChillerID,
        "chillerName": self.getSibling("ChillerName").props.text,
        "wo": self.getSibling("WorkOrder").props.value,
        "fromTank": self.getSibling("StartTank").props.value,
        "toTank": self.getSibling("EndTank").props.value,
        "extraTank1": self.getSibling("EndTank1").props.value,
        "extraTank2": self.getSibling("EndTank2").props.value,
        "lot": self.getSibling("LotNumber").props.text,
        "feedtype": self.getSibling("FeedType").props.text,
        "prodtempmin": self.getSibling("ProdTempMin").props.value,
        "prodtempmax": self.getSibling("ProdTempMin").props.value,
        "jobtype": self.getSibling("JobType").props.value,
        "status": self.getSibling("Status").props.value,
        "statusreason": self.getSibling("StatusReason").props.value,
        "comment": self.getSibling("Comments").props.text,
        "timestamp": self.getSibling("LogDate").props.text,
        "dt": self.getSibling("MonthYear").props.text,
        "user": self.session.props.auth.user.userName
    }
        
    system.db.runNamedQuery(path, params)

Consider also reading though this thread, especially this post in particular:

3 Likes