Email after Processed  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Email after Processed

Postby DannyC » Thu Jun 24, 2021 5:34 pm

Using this as a basis viewtopic.php?f=26&t=592
I have a plugin which emails the debtor when a sales order is processed. Plugin attached.

It works fine when the print selection box is opted to "No Report".

But if the user chooses "Single Report" or "Report Type" I get an error "Unable to start the print job. It may not be possible in the current security context."

I've been scratching my head over this one for quite some time & just can't work out where the plugin is faulty. Would appreciate a heads up!
Attachments
Plugin Attkey Sales Orders. Email after Processed.xml
(44.73 KiB) Downloaded 542 times
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Email after Processed

Postby Mike.Sheen » Thu Jun 24, 2021 5:46 pm

I get an exception when processing a sales order with your plugin because it's referring to a custom field "ProcEmail" which isn't defined anywhere by the plugin (it's probably in a different plugin of yours?).

Having said that, I don't think that's related to the error you are getting. That particular message is more related to the printer configuration - check the print groups for the user you are testing as and make sure the printer for the sales order report exists for that user.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Email after Processed  Topic is solved

Postby Scott.Pearce » Thu Jun 24, 2021 5:59 pm

I think the user may be using Jiwa via RDS and is trying to print to a redirected printer which is either not mapped via their session or is no longer valid.

Check Jiwa logical printers and try to avoid mapping to logical printers to RDS-mapped printers. Such printers should be shared and accessible as a local printer via the RDS server.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230

Re: Email after Processed

Postby DannyC » Thu Jun 24, 2021 11:56 pm

Sweet. I fixed up my logical printers. I needed to specify an actual printer not just leave default as blank.

new error.
Unable to update table SO_Main with InvoiceNo [100570],
InvoiceID [whatevertheIDis]

It performs the print and processes the invoice but doesn't email.

EDIT:
I've worked it out...I needed to add a line in the processed sub to re-read the sales order after it had been printed, i.e.
Code: Select all
   Public Sub salesOrder_Processed(sender As Object, e As System.EventArgs)
      Dim salesOrder As JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder = DirectCast(sender, JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder)
      salesOrder.Read(salesOrder.InvoiceID)


Thanks for the help as always.
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Email after Processed

Postby SBarnes » Fri Jun 25, 2021 9:00 am

Try re-reading the sales order before you do anything, the processing will have just performed as save so reading it will set everything back to where it needs to be in terms of statuses etc.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests