|

Convert pdf or any type of file to base 64 string in AX using x++

Here is a code snippet to convert any file into a base64 string in x++ using some dot net inbuilt classes in AX. To convert it, initially clrinterop permission must be granted to access the dot net inbuilt classes then load the file into file info, initialize the byte array with the length of file,…

|

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,…

|

calculate total sales order or sales quotation amount / discounts / tax etc., through code( X++ ) in AX

I have seen that few developers have a problem in getting the total Sales order amount or sales quotation amount with Tax /discounts etc., in the preferred currency before invoicing because these are not stored into any specific tables. The below form shows, where we can see the sales totals, Accounts Receivable->Sales Order-> Inquiries Menu->Totals…

|

Print Sales Invoice Report in PDF / HTML / RTF / ASCII etc., format through code

I have observed that lot of developers face difficulty in printing the Sales Invoice report into file system through code. Here is the code snippet for it. SalesFormLetter salesFormLetter; PrintJobSettings printJobSettings; CustInvoiceJour custInvoiceJour; SalesId salesId; #File salesid = “SO-100010”; salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice,false); printJobSettings = new PrintJobSettings(); printJobSettings.setTarget(PrintMedium::File); printJobSettings.format(PrintFormat); printJobSettings.fileName( ‘//10.0.57.22/AOSPrintShare//’ + salesId+#pdf ); printJobSettings.warnIfFileExists(false); SalesFormLetter.updatePrinterSettingsFormLetter(printJobSettings.packPrintJobSettings());…

|

send e-mail through code with attachments in AX

1. To send an email through AX, Initially we need to configure the e-mail parameters in the administration module. 2. If you want to configure an email template. That can also be done from the basic module. LanguageId LanguageId; FilePath FilePath; SysMailer mailer; SysEmailAddress ToAddress; SysEmailId EmailId; new InteropPermission(InteropKind::ComInterop).assert(); FilePath = @’//10.0.23.25/AOSPrintShare/TestSalesOrder.pdf; mailer = New…

|

How to use COM Wrapper dll in AX

Here, I am telling you about how to register a COM wrapper dll and then extract & use it in AX. (i) Install the COM Wrapper DLL Files, into the bin directory of the AOS. (ii) Register it with the following Command,%WINDIR%Microsoft.NETFrameworkv2.0.50727regasm.exe Test.Wrapper.DLL /tlb:Test.Wrapper.tlb (iii) Now, After Successful Registration, Follow the below path and click…

|

Common problem in Printing AX Reports as a file using Batch job scheduling through code in the Server File System

I have come across many people having a problem in printing the AX reports into the file system of server using batch job scheduling………… The main problem is in configuration……… The solution is pretty simple and is as follows: As AX batch job scheduling always runs on the server, the below configuration has to be…

My First Blog

Hi Everyone,My name is Giridhar Raj Singh Chowhan.I have been working on Microsoft Dynamics AX for over 2.5 years as a Technical Consultant………For a long time, I have been thinking of blogging about my experiences in AX………..Atlast today I have started blogging………….It is always very exciting when you start something new……….My main motto of starting…