Langsung ke konten utama

Postingan

Menampilkan postingan dari November, 2016

Add an Image/Icon to an Action Pane Button [AX 2012]

Let start with the result. Below is a screenshot of Super Mario replacing the Customer icon. This is becoming a common question with AX 2012 using Action panes and all the buttons having images associated to them. It definitely adds to the usability. Follow the below steps and you’ll be alright. Get your icon file You can purchase your icon file on line or create them. To create them, create a png file with transparent background. Use either Photoshop or equivalent Gimp (free). Just Google on how to make an image transparent (I am very inexperienced and I got by – most people should be fine). Then go to  http://www.convertico.com/  and load up your png to convert to an ico file. From here on it is all standard AX. To add an image resource to the AOT In the AOT, right-click  Resources , and then click  Create from File . The  Select file  window opens. Navigate to the location of the image file that you want to use for a button. Click the file, and then click  Open

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

Friends, This is the most commonly asked requirement of saving the report to pdf and send it to through email. We all know that SRSReportRun class is helpful in combination with printDestinationsettings to save to pdf file. But tricky requirements are those which uses controller classes for the report. Below is the small snippet which will help to save the sales invoice report to pdf that actually uses controller classes. 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);         salesInvoiceController =  new  SalesInvoiceController();     salesInv

Unable to construct an object from the class in the batch framework - AX

Error :  " Unable to construct an object from the class Sample Class in the batch framework. Make sure that the X++ code has been compiled to Microsoft .NET Framework CIL, and that the constructor does not require any parameters " Solution : It is going to take about 2-3 minutes (it depends from environment to environment). Then, to double check if the job run well, go to System Administration > Inquiries > Batch Jobs and look for your job. It status should now be Ended. Enjoy

Joins in X++ into T-SQL

1.  join  in X++: select AccountNum from custTable join TaxGroupId from custGroup where custGroup.CustGroup == custTable.CustGroup; CROSS JOIN  in T-SQL: SELECT T1.ACCOUNTNUM , T1.RECID , T2.TAXGROUPID , T2.RECID FROM CUSTTABLE T1 CROSS JOIN CUSTGROUP T2 WHERE (( T1.PARTITION =?) AND ( T1.DATAAREAID =?)) AND ((( T2.PARTITION =?) AND ( T2.DATAAREAID =?)) AND ( T2.CUSTGROUP = T1.CUSTGROUP )) 2.  outer join  in X++: select AccountNum from custTable outer join AccountID from custBankAccount where custBankAccount.CustAccount == custTable.AccountNum; LEFT OUTER JOIN  in T-SQL: SELECT T1.ACCOUNTNUM , T1.RECID , T2.ACCOUNTID , T2.RECID FROM CUSTTABLE T1 LEFT OUTER JOIN CUSTBANKACCOUNT T2 ON ((( T2.PARTITION =?) AND ( T2.DATAAREAID =?)) AND ( T1.ACCOUNTNUM = T2.CUSTACCOUNT )) WHERE (( T1.PARTITION =?) AND ( T1.DATAAREAID =?)) 3.  exists join  in X++: select AccountNum from custBankAccount exists join custTable where