Skip to main content

Posts

Creating General Journals in AX 2012 in X++

AxLedgerJournalTable header =  new  AxLedgerJournalTable(); AxLedgerJournalTrans trans =  new  AxLedgerJournalTrans(); container   ledgerDimensions, offsetDimensions;    header.parmJournalName("GenJrn");   header.save();      trans.parmAccountType(LedgerJournalACType::Ledger);   trans.parmJournalNum(header.ledgerJournalTable().JournalNum);   ledgerDimensions = ["131100-USA","131100",  1 , "COUNTRY","USA"];   trans.parmLedgerDimension(AxdDimensionUtil::getLedgerAccountId(ledgerDimensions));   trans.parmAmountCurDebit( 230 );   offsetDimensions = ["0103-USA","0103",  1 , "COUNTRY", "USA"];   trans.parmOffsetLedgerDimension(AxdDimensionUtil::getLedgerAccountId(offsetDimensions));   trans.save();

Calling the LedgerGeneralJournal Service in AX 2012

GeneralJournalServiceClient  client =  new   GeneralJournalServiceClient (); CallContext  context =  new   CallContext (); context.Company =   "ceu" ; AxdLedgerGeneralJournal  journal =  new   AxdLedgerGeneralJournal (); AxdEntity_LedgerJournalTable  journalHeader =  new   AxdEntity_LedgerJournalTable (); journalHeader.JournalName =  "GenJrn" ; AxdEntity_LedgerJournalTrans  journalLine =  new   AxdEntity_LedgerJournalTrans (); journalLine.AccountType =  AxdEnum_LedgerJournalACType .Ledger; journalLine.AccountTypeSpecified =  true ; journalLine.Company =  "ceu" ; AxdType_MultiTypeAccount  account =  new   AxdType_MultiTypeAccount (); account.Account =  "131100" ; account.DisplayValue =  "131100-OU_2311-OU_3569-Customer visit" ; AxdType_DimensionAttributeValue  dimValue1 =  new   AxdType_DimensionAttributeValue...

Dynamics AX 2012 Reporting: How to specify new design for Sales order confirmation

Sales order confirmation report is one of the special reports which are manage by print management. When we create new design in Visual Studio for out Sales order confirmation report and we want to use it it is not enough to change the code. Even those we will change the code in class AOT\Class\SalesConfirmationController method main from: controller.initArgs(_args,ssrsReportStr(SalesConfirm,Report) to controller.initArgs(_args,ssrsReportStr(SalesConfirm,Report_NewDesign) that will not be picked up and sales confirmation will be still printed in old design. To change the design you need to: If you go to Account receivable > Setup > Forms > Form setup Click on button Print management You will see that by default report format is set up to: SalesConfirm.Report If you want to use every time your new design then you can select for Report format your desire design. If your desire format does not appear in drop down list you will need to edit method popula...

Importing Products into AX 2012

EcoResProductServiceClient service = new EcoResProductServiceClient();             CallContext ctx = new CallContext();             ctx.Company = "ceu";             AxdEcoResProduct axdProduct = new AxdEcoResProduct();                         //first, create a distinct product             AxdEntity_Product_EcoResDistinctProduct distinctProduct = new AxdEntity_Product_EcoResDistinctProduct();             distinctProduct.DisplayProductNumber = "Bulb60W";             distinctProduct.ProductType = AxdEnum_EcoResProductType.Item;     ...

Importing Customers, Vendors and Products in AX 2012

This calls the vendor service: using System; using System.Collections.Generic; using System.Linq; using System.Text; using ConsoleApplication9.Vendors; namespace ConsoleApplication9 {     class Program     {         static void Main(string[] args)         {             VendTableServiceClient proxy = new VendTableServiceClient();             CallContext context = new CallContext();            context.Company = "ceu";  //New class that replaces AX endpoints.  It makes it obvious which company you are importing data into.  I love this class!!              AxdVendTable vendor = new AxdVendTable();      ...

Steps to Restore an AX Database

In support we ask customers for backups of their databases to investigate issues that do not occur in the demo data.  We usually also request a copy of their application files so the code files match the database.  Below are the steps I take to get the database backup and application files in a working state in my environment.  If you need more than the AX client and AOS to work with the customer's database, for example if you need to test batch servers, EP or SSRS with the customer's files, have a look at this article as it covers some of those more fringe scenarios: http://blogs.msdn.com/b/emeadaxsupport/archive/2010/02/17/reformatted-checking-database-entries-after-restoring-a-microsoft-dynamics-2009-sql-database-to-another-domain-or-environment.aspx Pre-requisites In my existing environment I have a running instance of AX 2009 that is on sp1.  If the customer is on AX 2009 I assume the customer is on sp1 since most are.  The AOS, SQL server and AX ...

User security role assignment report [AX 2012]

There isn’t a report that lists the users and their security roles. You can get this information fairly quickly through Excel add-in. 1. Go to the AOT and find the Query SysSecRolesForUser. 2. Duplicate it and remove the code (it has code in the init method to filter by current user). Then just go the organization > “Document data sources”. Select your query and activate it. 3. In Excel select the service, select the fields and run. You should see a nice list of user and their roles.