Posts

Showing posts from March, 2014

Managing integration ports AX 2012

Image
What are Integration ports? Integrations ports are basically the inbound or outbound ports through which external applications can communicate with Dynamics AOS via AIF (WCF). The exchange of data between External/Internal application is divided into: 1.        InBound Exchange a.       Both Basic and Enhanced Integration ports can be used. b.       Basically to Receive data and create in Ax 2.       OutBound Exchange a.       Only Enhanced Integration ports can be used. b.       To Send data to ext. applications c.        To Send data to ext. applications in response to their Requests   How to: Create a Basic Inbound Integration Port [AX 2012] Basic port is used to test the operation of a custom service that does not require any data processing or exposure to the Internet. O...

Generation;The given key was not present in the dictionary

Image
While working, I encountered this error. The error is mentioned in the image below: And the compilation log had the following error: I was able to solve the error by carrying out the outlined steps: 1.Restart AOS Service 2.Generate Full CIL In case, you do not have enough time for the Full compilation, go the error log and recompile the objects mentioned in the error message.

Creating a Customer Form at Run Time in X++

The job “CustomerForm” creates a customer form at run time in x++. In the form, I have used two datasources “CustTable” and “DirPartyTable”. I have also shown how to add menuitemfunctions in a form through X++. Here is the code in X++: public static void CustomerForm(Args _args) { //Initialization DictTable dictTable; DictTable dictTable1; Form form; FormBuildDesign design; FormBuildDataSource formBuildDataSource; FormBuildDataSource formBuildDataSource1; FormBuildActionPaneControl actionPane; FormBuildActionPaneTabControl actionPaneTab; FormBuildButtonGroupControl buttonGroup1; FormBuildButtonGroupControl buttonGroup2; FormBuildCommandButtonControl CommandNew; FormBuildCommandButtonControl CommandDelete; FormBuildMenuButtonControl CustomerButton; FormBuildFunctionButtonControl NewCustomerButton; FormBuildFunctionButtonControl ForecastButton; FormBuildGroupControl Grp; FormBuildGridControl grid; FormBuildGroupControl grpBody; Args args; FormRun formRun; #task //Adding DataSourc...

The SysOperation Framework Overview

Previously, the Runbase framework was being used to add the functionality that required batch processing. The Runbase framework has been replaced by the SysOperation framework, formerly known as Business Operation Framework. The Sysoperation framework creates a user interface which can be integrated with the batch server for batch processing. The SysOperation framework can be used to implement operations that can scale to multiple processors by batch processing. It can also be implemented to prompt the user for an input. The batch processing feature can be used to control the time and duration of the operations which require more processing time. The framework also has support for queries, routing tasks and pack and unpack for parameter serialization. The SysOperation framework basically enhances the performance of operations by explicitly scheduling their execution. Through the framework, the operations can be executed on user interaction or by scheduling them through the batch s...

Dynamics AX 2012 Data Import using X++

Image
Microsoft Dynamics AX 2012 Xpp – Sales Orders Import Microsoft Dynamics AX 2012 Xpp – Sales Orders Import   Purpose:  The purpose of this document is to illustrate how to write a required minimum X++ code in Microsoft Dynamics AX 2012 in order to import Sales orders.   Challenge : Data model changes in Microsoft Dynamics AX 2012 related to high normalization and introduction of surrogate keys made some imports more complex. However the structure of tables comprising Sales order header/lines didn't change. Please note that after you import Sales orders you may need to perform full/partial Physical and/or Financial update if required (for example, for Purchase orders already in execution).   Solution : Appropriate tables buffers (SalesTable, SalesLine) will be used when writing X++ code in Microsoft Dynamics AX 2012 in order to import Sales orders. Alternatively AxBC classes may be used instead of table buffers.   Data Model :  ...

X++ code to filter a lookup field on form in ax2012

lookup for custaccount field, when open the custtable (custaccount field)  form public void lookup() { Query query = new Query(); QueryBuildDataSource qbds_CustTable; SysTableLookup sysTableLookup; QueryBuildRange qbr; //super(); sysTableLookup = SysTableLookup::newParameters(tablenum(CustTable), this); qbds_CustTable = query.addDataSource(tableNum(CustTable)); sysTableLookup.addLookupfield(fieldnum(CustTable, AccountNum), true); sysTableLookup.addLookupfield(fieldnum(CustTable, CustGroup),true); qbr = qbds_CustTable.addRange(fieldNum(CustTable,CustGroup)); qbr.value(‘ENDUSER’); sysTableLookup.parmUseLookupValue(false); sysTableLookup.parmQuery(query); sysTableLookup.performFormLookup(); } About these ads

Excel file import using X++ Code

In order to import data into AX from Excel through X++.. Excel file import using X++ code: static void Salestargetdataimport(Args _args) { #AviFiles SysOperationProgress progress = new SysOperationProgress(); SysExcelApplication application; SysExcelWorkbooks workbooks; SysExcelWorkbook workbook; SysExcelWorksheets worksheets; SysExcelWorksheet worksheet; SysExcelWorkSheet workSheetInventTableModule; SysExcelCells cellsInventTableModule; SysExcelCells cells; COMVariantType type; COMVariantType typeModule; DataEntryForm DataEntryForm1; int row = 0; FileIoPermission perm; dipl_monthsofyear months; year1 year1; Country Country2; #define.Filename('D:\Manish_Sales_to_Ax.xlsx') #define.FileMode('R') ; perm = new FileIOPermission(#FileName, #FileMode); perm.assert(); application = SysExcelApplication::construct(); workbooks = application.workbooks(); try { workbooks.open(#Filename); } catch (Exception::Error) { throw error("File cannot be opened."); } workbook =...

Document management in AX 2012

Image
In Dynamics Ax 2012, you can attach documents to specific records. This can be done by clicking the "Attachments" button on the Ribbon for many forms. Below is a screen capture for Workers form:  The picture isn't clear, this is just to give an idea where you should possibly look for Attaments button.   But before you go ahead with Document attachments, you need to setup few things listed below:  Activate Document management Set up Archive Directory - place to store the documents Create required Document types Use Document management to attach files to records in any Dynamics Ax Form. Activate Document Management:  Complete the following procedure to activate document management. C lick  File  >  Tools  >  Options .  Click  General  and then expand the  Miscellaneous  FastTab.  Select the  Document handling active  check box.  Select  Show attachment st...