SO Custom Email  Topic is solved

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

SO Custom Email

Postby 2can2 » Fri Jul 10, 2015 6:07 pm

Hi, I am working on V70115 on Sql2008R2 and have modified the SO Custom Email Plugin. I have copied the section of code from 'Debtor Statement Emailing' where it gets the Email addresses of Contacts with Position 1,2,3 = 'Email Statements' - Lines 59 - 110. I had changed the check to be 'LIKE '2%Stat%' on the Statement plugin and it works great. I have modified this for the SO to be 'LIKE '2%Inv%'.
Having looked at the code I thought the Sql fetch would transfer to the SO Email without any changes. I inserted it before the email address is inserted -
emailReportDialog.EmailTo = debtor.EmailAddress 'salesOrderForm.SalesOrder.Debtor.Email
I have come up with an error though - it tells me that on Line 62 'Type : SqlDataReader is not defined'
I can't find any other reference to SqlDataReader in the 'Debtor Statement Emailing' so not sure what I need to do.
Could you please advise. XML attached.
Thanks
Attachments
JMS Plugin Sales Order Custom Email.xml
(30.78 KiB) Downloaded 455 times
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25

Re: SO Custom Email  Topic is solved

Postby Mike.Sheen » Wed Jul 15, 2015 7:31 pm

2can2 wrote:'Type : SqlDataReader is not defined'
I can't find any other reference to SqlDataReader in the 'Debtor Statement Emailing' so not sure what I need to do.


Hi Doug,

Add the following to the top of the plugin code:

Code: Select all
Imports System.Data.SqlClient


This imports the namespace System.Data.SqlClient into the assembly - SqlDataReader is actually System.Data.SqlClient.SqlDataReader - so you can refer to it as the fully namespaced name "System.Data.SqlClient.SqlDataReader", but that gets a bit tiring after a while so adding the "Imports System.Data.SqlClient" in the code before any class definitions will allow you to use simply "SqlDataReader" instead.

Mike
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: SO Custom Email

Postby 2can2 » Thu Jul 23, 2015 11:06 am

Thanks Mike. That helped greatly! I had a few more issue but eventually got it to work.

Cheers
2can2
Frequent Contributor
Frequent Contributor
 
Posts: 171
Joined: Tue Feb 26, 2008 10:24 am
Topics Solved: 25


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests

cron