web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Send Sales Order confirmations via batch - set up need help

(0) ShareShare
ReportReport
Posted on by 34

Hello, 

   I am trying to set up the out of the box batch job  (<comapny>/Accounts receivable/Common/Sales orders/All Sales orders under the Sell tab clicking on the Confirmation button) to send out the SO confirmations. The batch should automatically pick up all the SOs based on the criteria provided in the Select (d) on the 'Confirm sales order' screen and shoud send the emails out to the primary email contact for that sales order. When it is not setup as a batch job it does send out the emails but failing when setup as a batch job. Below is the error I see in the System admin/batch jobs/select the batch job/and go to the View tasks under the log section I see the below errors. 

Error:

Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.

at Microsoft.Dynamics.Ax.MSIL.Interop.throwException(Int32 ExceptionValue)

at Microsoft.Dynamics.Ax.MSIL.Interop.ThrowCQLError(IL_CQL_ERR cqlErr)

at Microsoft.Dynamics.Ax.Xpp.CastHelper.ToBoolean(Object _value)

at Dynamics.Ax.Application.MAS_GlobalCacheEmailLogController.Setglobalcache(Int64 _jourRecId, Int32 _tableId, Int64 _masterTableRecId) in MAS_GlobalCacheEmailLogController.setGlobalCache.xpp:line 15

at Dynamics.Ax.Application.SalesConfirmController.main(Args _args) in SalesConfirmController.main.xpp:line 67

at SalesConfirmController::Main(Object[] )

at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

at Dynamics.Ax.Application.MenuFunction.Run(xArgs _args, Boolean ) in MenuFunction.run.xpp:line 76

at Dynamics.Ax.Application.CustConfirmJour.Printjournal(FormletterJournalPrint formletterJournalPrint, RecordSortedList journalList, Boolean , Boolean ) in CustConfirmJour.printJournal.xpp:line 21

at Dynamics.Ax.Application.CustConfirmJour.Printjournal(FormletterJournalPrint formletterJournalPrint, RecordSortedList journalList)

at Dynamics.Ax.Application.SalesConfirmJournalPrint.Doprint() in SalesConfirmJournalPrint.doPrint.xpp:line 7

at Dynamics.Ax.Application.FormletterJournalPrint.Printjournal(Set _journalList) in FormletterJournalPrint.printJournal.xpp:line 37

at Dynamics.Ax.Application.FormletterService.Printjournal() in FormletterService.printJournal.xpp:line 34

at Dynamics.Ax.Application.FormletterService.Printout() in FormletterService.printOut.xpp:line 13

at Dynamics.Ax.Application.FormletterService.Endposting(Printout _printout) in FormletterService.endPosting.xpp:line 14

at Dynamics.Ax.Application.FormletterService.Endpostingmultithread() in FormletterService.endpostingMultithread.xpp:line 25

at Dynamics.Ax.Application.FormletterServiceEndBatchTask.Run() in FormletterServiceEndBatchTask.run.xpp:line 13

at Dynamics.Ax.Application.BatchRun.runJobStaticCode(Int64 batchId) in BatchRun.runJobStaticCode.xpp:line 54

at Dynamics.Ax.Application.BatchRun.runJobStatic(Int64 batchId) in BatchRun.runJobStatic.xpp:line 13

at BatchRun::runJobStatic(Object[] )

at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)

at BatchIL.taskThreadEntry(Object threadArg)

I am not sure if I need to customize something to make this happen. Can any please shed some light here? 

Our AX version: 

AX 2012 R3 CU12

Thanks,

Dave

*This post is locked for comments

I have the same question (0)
  • Sukrut Parab Profile Picture
    71,699 Moderator on at
    RE: Send Sales Order confirmations via batch - set up need help

    Do you have any other functionality where sending email  in a batch mode working ? Do you full IL generated ?

  • Suggested answer
    Mohammed Khatib Profile Picture
    430 on at
    RE: Send Sales Order confirmations via batch - set up need help

    Hello Dave,

    Are you trying to send the Confirmation to the Customer selected on the sales order, or to a static email address to the Sales team in your company?

    If the recipient email address to be dynamic and changes based on the customer account selected on the Sales order, then you need to do a customization to set the recipient email address, otherwise if the email should go to the sales team, make sure that the below is done:

    Under Accounts receivables --> Setup --> Forms --> Form Setup

    Click button Print Management

    Under documents, find Sales Order Confirmation

    Change the destination to be Email and Specify the email address to receive the confirmation as attachment

    Setup your batch job for Sales Order Confirmation form and make sure to select "Use Print Management Settings" as a print option.

    Thanks.

  • xpp Profile Picture
    34 on at
    RE: Send Sales Order confirmations via batch - set up need help

    HI Sukrut, I do not think we have any process in place that sends out emails in batch. I haven't done any development (put the code) to make this happen. Just trying to configure on the Confirm screen batch dialogue. So thought no need of generating IL code. I just did IL ran clean.

  • xpp Profile Picture
    34 on at
    RE: Send Sales Order confirmations via batch - set up need help

    HI Mohammed, It should send the email out to the customer(s) that have been returned based on the selection in the criteria that I have put in the select (d) criteria on the confirmation dialog.  So, the expectation is the look for the primary emails of the sales order and send it to the customer. Seems like I need to customize it then? I thought so too. But it does send emails when not run in a batch with no issues though.

  • Suggested answer
    Satish Panwar Profile Picture
    14,671 Moderator on at
    RE: Send Sales Order confirmations via batch - set up need help

    When not setup as a batch job, you are only working with a specific sales order OR multiple sales orders based on your select criteria. If you need to setup batch job for order confirmation, there is parameter "Late selection" on confirm sales order form, you need to set late selection to "Yes", that means query will be run later via batch job. Give this a try.

  • Suggested answer
    Satish Panwar Profile Picture
    14,671 Moderator on at
    RE: Send Sales Order confirmations via batch - set up need help

    Another question you asked is "send emails to customer email address", for that you need to use print management destination, check this out at AR > Form setup > General tab > print management. override settings for "sales order confirmation".

  • Suggested answer
    Mohammed Khatib Profile Picture
    430 on at
    RE: Send Sales Order confirmations via batch - set up need help

    Yes you need a customization for this matter in order to send multiple sales confirmations using batch job. I have the similar case where I am sending Purchase order confirmations to the vendors using batch job and it is working fine.

    Note: The main customization you need to do is to populate the vendor address on the print settings in order to send the confirmation to the correspondent people.

    I have created a separate class to print the document, save it in a temp folder as PDF, then create an Email (SysEmailTable::sendMail) with the attachment and the vendor email address populated as recipient. I also modified class SRSReportRunPrinter --> toEmail, in this method I am checking if the report name is PurchPurchaseOrder, then stop the out of the box process and call my custom class.

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans