Automating Jiwa from command line or script or other
Hi,
Version 7.0.129
Language: VB .Net
My situation:
I need to send an order confirmation automatically when a new sales order is saved in Jiwa without any user intervention (aside from a question "Would you like to send an order confirmation?").
I've found that I can only detect a new sales order on the SaveStart event. But if I send an email from that event, it needs the sales order saved first so I'm in a Catch 22.
So what I am doing as a workaround is to set a flag on SaveStart. I am setting History Status = 1 for now.
Then on SaveEnding, I am checking for HistoryStatus = 1, and sending the confirmation, then setting HistoryStatus back to 0. Unfortunately this then makes the sales order dirty again and it needs to be saved, so it ends up in this loop.
As an alternative, I am setting HistoryStatus = 1 on SaveStart then I am using a 3rd party tool to automatically send order confirmations to customers when a new sales order is created, checking for HistoryStatus = 1. This works well, but the problem I have is that the client also wants confirmation via the 'Emailed' indicator on sales orders that it has been sent. Back in version 6 I would've written to the SO_EmailLog table but in Jiwa 7 it seems it might be easier if I could call the .Net thingos (are they assemblies, or objects, or classes) to advise Jiwa that the email has gone.
I have been looking at this old(ish) post regarding automating Jiwa using Powershell.
viewtopic.php?f=27&t=167 . I think if I could write a Powershell script, passing in as a parameter the InvoiceHistoryID then in theory I think I should be able to set that indicator.
Maybe I am barking up the wrong tree with Powershell, or even using the 3rd party software to send the order confirmation. I either need the plugin to work OK (note that the client is still on 7.0.129) which is preferable because it writes to the email log nicely. Or I need a quick heads up on how to set the email indicator from outside Jiwa. I don't really need the whole email & attachment as binary saved in Jiwa, just that the indicator is set with the email details (To, Subject, staff, datetime etc). I am also a complete & utter newbie on Powershell so I would need to give myself a crash course in it, and I don't have that luxury of time.
What would you suggest?
Version 7.0.129
Language: VB .Net
My situation:
I need to send an order confirmation automatically when a new sales order is saved in Jiwa without any user intervention (aside from a question "Would you like to send an order confirmation?").
I've found that I can only detect a new sales order on the SaveStart event. But if I send an email from that event, it needs the sales order saved first so I'm in a Catch 22.
So what I am doing as a workaround is to set a flag on SaveStart. I am setting History Status = 1 for now.
Then on SaveEnding, I am checking for HistoryStatus = 1, and sending the confirmation, then setting HistoryStatus back to 0. Unfortunately this then makes the sales order dirty again and it needs to be saved, so it ends up in this loop.
As an alternative, I am setting HistoryStatus = 1 on SaveStart then I am using a 3rd party tool to automatically send order confirmations to customers when a new sales order is created, checking for HistoryStatus = 1. This works well, but the problem I have is that the client also wants confirmation via the 'Emailed' indicator on sales orders that it has been sent. Back in version 6 I would've written to the SO_EmailLog table but in Jiwa 7 it seems it might be easier if I could call the .Net thingos (are they assemblies, or objects, or classes) to advise Jiwa that the email has gone.
I have been looking at this old(ish) post regarding automating Jiwa using Powershell.
viewtopic.php?f=27&t=167 . I think if I could write a Powershell script, passing in as a parameter the InvoiceHistoryID then in theory I think I should be able to set that indicator.
Maybe I am barking up the wrong tree with Powershell, or even using the 3rd party software to send the order confirmation. I either need the plugin to work OK (note that the client is still on 7.0.129) which is preferable because it writes to the email log nicely. Or I need a quick heads up on how to set the email indicator from outside Jiwa. I don't really need the whole email & attachment as binary saved in Jiwa, just that the indicator is set with the email details (To, Subject, staff, datetime etc). I am also a complete & utter newbie on Powershell so I would need to give myself a crash course in it, and I don't have that luxury of time.
What would you suggest?