Need to use Print Management setting to send email.

Hi Everyone,

I need to use print management setting via x++ code to send the posted packing slip.

The difficulty I am facing here is getting the query for email ID: test@123.com configured for “Purchase order packing slip” through code.

Even I get that it would be helpful.

My code should run on the server, since i am going to use this AIF service.

Thanks in Advance.

I’m sorry, but I don’t understand your question. Could you give a more detailed explanation, please?

Hi Martin,

Thanks for the reply.

I need to get the default email “Destination” through code configured for “purchase order packing slip” in “Print management setting” which is “test@123.com” as highlighted above.

My requirement: I am posting a Packing slip through custom service. Client wants to send the email of the posted packing slip which is configured in the print management setting.

So, I am going to generated the report as PDF and store it in a path, then I am going t o send a mail using “Sysmailer” class.

I need to get the email id configured in “print management setting”.

I debugged it, but I am unable to get where the email id is stored.

Any suggestions will be helpful.

Why don’t you leave it to print management? Why are you reimplementing what at it already does?

Hi Again,

First, I used the print management setting in “purchformletter” class as below.

// Posting the packing slip.
purchFormLetter.update(PurchTable, // Purchase record Buffer.
packingslipnumber, // Packing Slip Number.
systemdateget(),
PurchUpdate::Recorded, 0, // Posting the Registered Quantity.
false,
true,
true); // Use print management setting.

But this code calls the “SysInetMail” class which runs on the “client” for sending the mail.

So when I use the above code in web service, “SysInetMail” is not getting called.

For this reason, I am going to re implement this and I am trying to use “SysMailer” class which runs on “called from”.

Thank You,

Goutham

I think that print management stores these settings in PrintMgmtSettings.PrintJobSettings.
You can pass the value to SRSPrintDestinationSettings’s constructor and then call its emailTo() method.

Hi Martin,

Thanks. But I think the above suggestion is for AX 2012. I am using AX 2009.

Ah, sorry - unfortunately I don’t have any AX 2009 environment.
But I’m pretty sure that it’s stored as packed PrintJobSettings in AX 2009 as well. Look at what the print management form does to find the right table.