Creditor Cheque Payment Emailing  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Creditor Cheque Payment Emailing

Postby perry » Fri Aug 12, 2016 12:43 pm

Hi,
Jiwa 7.0.157,

The task is similar to debtor statement emailing plugin, client wants to use a specific contact email address instead of the creditor's email address.

I tried "UltraToolbarsManager1.ToolClick" for "ID_RecordEmail", though, the event is called after the popup form is closed.
In the end my work around is to
Code: Select all
...
AddHandler CreditorChequePayment.ReadEnd, AddressOf ChequePaymentReadEnd
...

For Each creditor As JiwaCreditorChqPay.Creditor In chqpay.Creditors
    SetCreditorEmailAddress(creditor)
Next


Can you please advise if there is anything obviously wrong? or if there is a better way to achieve this?
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15

Re: Creditor Cheque Payment Emailing  Topic is solved

Postby Mike.Sheen » Sat Nov 12, 2016 11:48 am

Hi Perry,

When you want to interact with dialogs, the best way is usually to intercept them from the Dialog factory - as these dialogs usually don't expose events needed to customise their behavior.

So, in the FormPlugin class something like this should suit your needs:

Code: Select all
Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
   AddHandler JiwaApplication.Manager.Instance.DialogFactory.AfterDialogStart, AddressOf AfterDialogStart
End Sub

Private Sub AfterDialogStart(ByVal JiwaDialog As JiwaApplication.IJiwaDialog)
  If TypeOf JiwaDialog Is JiwaCreditorChqPayUI.EmailRemittance Then
   Dim emailRemittanceDialog As JiwaCreditorChqPayUI.EmailRemittance = JiwaDialog
   Dim creditorChequePaymentForm As JiwaCreditorChqPayUI.CreditorChqPay = emailRemittanceDialog.Owner
   
    ' Populate the EmailAddress column of the grid with the desired addresses - this is then used as the recipient for the emails
   For row As Integer = 0 To emailRemittanceDialog.BatchJiwaGrid.ActiveSheet.RowCount - 1         
      If emailRemittanceDialog.BatchJiwaGrid.GridText("Email", row) = True Then
         emailRemittanceDialog.BatchJiwaGrid.GridText("EmailAddress", row) = "[email protected]"
      End If
   Next
  End If
End Sub


Attached is a plugin which uses the above to override the addresses - the result is the email dialog looks like this:
CreditorEFTEmailDialog.PNG
Example output
Attachments
Plugin Creditor EFT Emailing overide to address.xml
Updated to be 7.2 compatible
(34.33 KiB) Downloaded 62 times
Plugin Creditor EFT Emailing overide to address.xml
Sample Plugin
(31.28 KiB) Downloaded 163 times
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Creditor Cheque Payment Emailing

Postby Ernst » Fri Jun 01, 2018 2:34 pm

In addition to Mike's plugin. This plugin, will retrieve the email address from the alternative email address on the Contact tab.

Just adjust the primary ID to get your Remittance Primary ID.....:) :D
Attachments
Plugin Creditor EFT Emailing overide to address.xml
(32.97 KiB) Downloaded 166 times
User avatar
Ernst
Kohai
Kohai
 
Posts: 219
Joined: Tue Feb 19, 2008 3:43 pm
Topics Solved: 12


Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 26 guests