The functionality to use hook files is available from within the Job screen (Save and Invoice Now) in version 9.108 onwards..
Hook files do not run when saving Template Jobs
Hook Files should be saved to :
Data\Job Hook Files\PreSave
Data\Job Hook Files\PostSave
Data\Job Hook Files\PreInv
Data\Job Hook Files\PostInv
Files will be executed in Alphabetical (ASCII) order for each function.
PreSave
• JCMAINT2 when user clicks SAVE – Occurs before the data is written from the form, if the function returns False the Job will not be saved and the Job form will remain open.
Public Parameters gcHookJobID, gcHookFunction, and gcHookForm are available
PostSave
• JCMAINT2 after the data is written to disc
Public Parameters gcHookJobID, gcHookFunction, and gcHookForm are available
PreInv
• JCMAINT2 when the user clicks Invoice Now – Occurs before the data is saved from the form.
Execution will halt if the hook file returns False, The Invoice will not be created and the JCMAINT2 form for will remain open.
Public Parameters gcHookJobID, gcHookFunction, and gcHookForm are available
• CUST_INVOICE when the user clicks Save or Post – Occurs before the data is saved from the form.
If the invoice was started from the JCMAINT2 form then this function is not run when the user saves or posts from the invoice screen.
If the user recalls a Saved Job Invoice and saves or posts, this function is triggered.
Execution will halt if the hook file returns False, The Invoice will not be saved and the CUST_INVOICE screen will remain open.
Public Parameters gcHookJobID, gcHookFunction, and gcHookForm are available
Use the gcHookForm Parameter if you only want your function to run from one of the JCMAINT2 or CUST_INVOICE screens
PostInv
• CUST_INVOICE when the user clicks Save or Post – Occurs after the data is written to disk.
• The return value of a postInv function does not stop further hook files executing.
• These functions are run BEFORE the Customer Invoice (POSTPOST) Hook Files are run.
Public Parameters gcHookJobID, gcHookFunction, and gcHookForm are available
Comments
0 comments
Please sign in to leave a comment.