sketch Posted March 2, 2009 Share Posted March 2, 2009 does anyone know if you can have a function in a module called when certain tasks occur, for example when an invoice is automatically generated, without using action hooks? also, it seems to me that the only way to call functionality within server modules is to have a button in the customButtonArray that references the function you want to call, is this correct? further more, when you do click a button that triggers a module function, e.g. Change Password, it takes the data saved in the database, not the data from the form, effectively meaning you have to change password, click save, then click "change password". again, am i doing something horribly wrong? Since there is no action hook for invoice creation (and even if there was, you'd then have to put code in the hook to determine if it was the right server module etc etc), i don't see an easy way to automatically call module functions. has anyone found a way around this problem, or have some documentation i could read? Thanks in advance 0 Quote Link to comment Share on other sites More sharing options...
Shaun Posted March 2, 2009 Share Posted March 2, 2009 Sketch. You can't trigger on actions unless its in the action hooks file. And you can only trigger on actions provided in that file. As for saving the password, that is a round about way to do it but thats correct. 0 Quote Link to comment Share on other sites More sharing options...
ServWise.com Posted March 2, 2009 Share Posted March 2, 2009 Sorry to hijack this thread but it seemed relevant. I am trying to build a function that will add the clients details to each invoice in a separate linked table when the invoice is created. I thought I would be able to do it via an action hook but as you've mentioned (And I have just found out) there does not seem to be one for when an invoice is created. It may be possible to run a script from the pdf generator and have the PDF sent attached to the invoice email which would in effect run the script on invoice generation I believe. All this would be irrelevant if WHMCS would kindly save customers data to the invoice. A simple (extensible) XML list in a text field would be perfect and allow it to accommodate unlimited custom user fields. We can then iterate through this list when we display the invoice. I believe is it illegal (in Europe at least) for the Invoice details to be changeable once the invoice has been created. At the moment it looks like in WHMCS it is. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.