Skip to main content

Posts

Showing posts from December, 2013

Store and retrieve an image in a table for a record in AX

The simplest way to store an image for a record into AX tables is by using the CompanyImage Menu Item. I will explain you with an example below: Generally, most of the customers would request for a functionality to store an image for an item. For this, there is no need of high customization. Initially, Goto the Design in InventTable Form and add a Display Menu Item called CompanyLogo to its button Group. Change the label of the Menu item button in the form. Now, open the InventTable form and click on the menu item and load an image associated with a record. This image will be stored in the CompanyImage table as a BLOB in a container with the refRecId, RefTableId and RefCompanyId of the associated record(Here Record of InventTable). Retrieving it and saving to file system again is pretty easy with the help of binData Class. Here is the supporting code snippet.... bindata   bin = new bindata(); str    content; container image; InventTable inventT...

Better business insight with Microsoft Dynamics AX 2012 R2

Many organizations struggle with providing business insight in a timely manner as resource-constrained IT departments can’t keep up with the requests from business users. Far too often users are spending too much unproductive time creating manual reports that are static and outdated. Facing ever-accelerating change and the pressure from more prevalent global competition, it is more important than ever that organizations have instant access to up-to-date financial and operational performance to spot trends and identify challenges so they can act early. In previous versions of Microsoft Dynamics AX we enabled business intelligence as part of the ERP experience. The business user can access important information throughout the solution, via Role Center pages, which are dashboards that provide an overview of information that pertains to a user’s job function and by using Microsoft BI technology such as Microsoft Excel. In Microsoft Dynamics AX 2012 R2 we further improved the BI capa...

How to print the SSRS report in dynamics ax 2012 from code.

SrsReportRun srsReportRun;     // initiate the report.     srsReportRun = new SrsReportRun ( "InventTruckTransactionReport.PrecisionDesign1" );     srsReportRun.init();     srsReportRun.reportCaption( "InventTruckTransactionReport.PrecisionDesign1" );     // set parameters name, value.     srsReportRun.reportParameter( "TruckTransDS_JournalId" ).value( "000161_070" );     // suppress the dialog     srsReportRun.showDialog( false );     if ( srsReportRun )     {         // run the report         srsReportRun.executeReport();     }

How to send emails from AX without requiring Outlook

Sending emails from AX has been somewhat of a pain when it tries to use Outlook. This post is a simple code modification to one method in \Classes\Info\reportSendMail. I did not develop this code, I merely tweaked it. The original poster's blog has disappeared, and I can only find non-working remnants all around the web of this, but it is just too useful not to repost. If you have Outlook 64bit edition, you might get the "Either there is no default mail client or the current mail client cannot fulfill the messaging request. Please run Microsoft Outlook and set it as the default mail client." Followed by an AX MAPI error. Or sometimes you may get the "A program is trying to access e-mail address information stored in Outlook."...Allow/Deny/Hlep. This change basically bypasses outlook. Put it in and give it a shot. void reportSendMail(PrintJobSettings p1) { //SysINetMail m = new SysINetMail(); System.Net.Mail.MailMessage mailM...

AX 2012 SSRS Report: Multiple report design under Print management

AX 2012 SSRS Report: Multiple design under Print management If new formats for Sales order confirmation/Picking/Packing/Invoice Purchase order postings etc. are needs to be added. Following steps needs to be performed. Step1. Create new Design for report under visual studio Step2. Add code to method: \Data Dictionary\Tables\PrintMgmtReportFormat\Methods\populate Add Code in the before TTSCOMMIT: addOther(PrintMgmtDocumentType::SalesOrderPackingSlip, ‘SalesPackingSlip.Report_XYZ,’SalesPackingSlip.Report_XYZ’ ,’XYZ’); Step 3. Setup the Format under: AR -> setup -> form setup -> Print management -> Sales order Packing slip original -> report format to SalesPackingslip.Report_XYZ Step 4. New Report design can be executed from use Print management from Inquiry journal forms or during posting by selecting Print management destination.

Save SSRS report to pdf that uses Controller classes [Dynamics AX 2012]

static   void  SR_SaveReportToPDFFromController(Args _args) {     SalesInvoiceController  salesInvoiceController;     SalesInvoiceContract    salesInvoiceContract;     Args                    args =  new  Args();     SrsReportRunImpl        srsReportRun;     CustInvoiceJour         custInvoiceJour;     ReportName              reportName =  "SalesInvoice.Report" ;     ;      select   firstOnly  custInvoiceJour;     args.record(custInvoiceJour);      ...