Microsoft_MVP_banner

AX 2012: Access Denied: ***Controller

Recently I came across the following exception while opening batch job via a menu item which has been written using sysOperation framework. It was happening only with non-admin users so the first thing I could think of permission/access issue. I checked all properties on menu item, everything seems to be set properly as required. Solution:  Created a new server method under security privilege which is created for menu item used to called this import routine.  Select required class, Under method dropdown type your required method [by default it list static methods], and set EffectiveAccess to Invoke.

AX 2012: StrFind and StrScan functions

Two standard functions strFind and strScan can be used based on business requirement for find a special character from an input string. Here is an example with both functions; Both functions return integer value. StrScan Function Int found = 0; Str target= “Dynamics AX 365 operation”;found = strScan(target, “365”, 0, strLen(target)); where parameters are; 1. string 2. string 3. position 4. number StrFind Function Int found = 0; Str target= “Dynamics AX 365 operation”; found = strFind(target, “X”, 0, strLen(target)); where parameters are; 1. string 2. character 3. position 4. number

AX 2012: Convert string to TitleCase using str2CapitalWord function

Requirement: Show customer name on report in TitleCase e.g. faisal fareed should display as Faisal Fareed Solution: str2CapitalWord function does the trick and accomplished the requirement. input string: “faisal fareed” output string: “Faisal Fareed” P.S. There is another function str2Capital which just converts the first letter of the first word e.g. “faisal fareed” will be converted to “Faisal fareed”

AX 2012 – Username and password keeps prompt on Home | Role center page

After Enterprise portal in being installed and have configured in AX 2012, sometimes username and password keeps prompt for Home | Role Center page. However, this is irrespective to AX as any web application can be configured in IE settings for username and password. First option Steps outlined on this MSDN page resolves this issue. https://msdn.microsoft.com/en-us/library/cc750194.aspx Second option IE explorer | Internet options | Security | Intranet (or your settings), Select custom level scroll to the bottom | User Authentication and select autologon depending upon your setup

AX 2012 – Create and Post hour journal through X++

Following job can be used to create, validate, and post hour journal in Project Management and Accounting module in AX 2012 R3. static void createHourJournal(Args _args) {     ProjJournalTableData    JournalTableData;     ProjJournalTransData    journalTransData;     ProjJournalTable        journalTable, journalTableUpdate;     ProjJournalTrans        journalTrans;     ProjTable               projTable;     ProjInvoiceTable        projInvoiceTable;     NumberSeq               numberSeq;     ProjJournalCheckPost    jourPost;     ProjQtyEmpl             qty;     JournalNumOfLines       numOfLines;     ttsBegin;     journalTableData = JournalTableData::newTable(journalTable);     journalTransData = journalTableData.journalStatic().newJournalTransData(journalTrans, journalTableData);     // Init JournalTable — header     journalTable.clear();     journalTable.JournalId      = journalTableData.nextJournalId();     journalTable.JournalType    = ProjJournalType::Hour;     journalTable.JournalNameId  = MROParameters::find().JournalHour;     journalTable.initFromProjJournalName(ProjJournalName::find(journalTable.JournalNameId));     journalTable.insert();     // Init JournalTrans — lines     journalTableData.initFromJournalName(journalTableData.journalStatic().findJournalName(journalTable.JournalNameId));     journalTrans.clear();     journalTransData.initFromJournalTable();     projTable           = ProjTable::find(‘000057’);     projInvoiceTable    = projTable.projInvoice();     journalTrans.setTransDate();     journalTrans.TransDate      = systemDateGet();     journalTrans.ProjTransDate  = systemDateGet();     journalTrans.ProjId         = projTable.ProjId;     journalTrans.Qty            = 7.5;     journalTrans.CategoryId     = ‘Category ID’;     journalTrans.LinePropertyId = ‘Line property ID’;     journalTrans.Worker         = DirPersonUser::currentWorker();     journalTrans.ActivityNumber = ‘Activity number’;     journalTrans.Txt            = ‘Sample Text’;     if (projInvoiceTable.CurrencyId)         journalTrans.CurrencyId = projInvoiceTable.CurrencyId;     else         journalTrans.CurrencyId = CompanyInfo::standardCurrency();     journalTrans.DefaultDimension   = projTable.DefaultDimension;     journalTrans.TaxGroupId         = ProjParameters::taxGroupInvoice(projTable.ProjId);     if (journalTrans.Worker)     {         journalTrans.setHourPrices();         journalTrans.setPeriodDate();     }     numberSeq = NumberSeq::newGetVoucherFromId(journalTable.VoucherNumberSequenceTable, false);     journalTrans.Voucher        = numberSeq.voucher();     journalTransData.create();     ttsCommit;         // Validating the journal     jourPost = ProjJournalCheckPost::newJournalCheckPost(true,true,JournalCheckPostType::Check,tableNum(ProjJournalTable),journalTable.JournalId);         // Posting the journal     jourPost = ProjJournalCheckPost::newJournalCheckPost(true,true,JournalCheckPostType::Post,tableNum(ProjJournalTable), journalTable.JournalId);     jourPost.run(); }

Microsoft Dynamics 365 – Combines ERP and CRM cloud services

Another Microsoft app that will combine ERP and CRM cloud services into a single bundle…. https://www.microsoft.com/en-us/dynamics/dynamics-365 Due to be available this fall, Dynamics 365 will feature apps for functions including financials, field service, sales, operations, marketing, project service automation and customer service. The apps can be independently deployed, allowing users to buy only what they need.

Microsoft Dynamics 365 for Operations – Tips and Questions

Deep dive into AX 7 – How development happens and where all source code stores;With AX 7, the development has moved back to file system, any technical change we make in the application is saved into an XML file. What does development environment include?The development environment is the one box deployment of AX 7 with its own local SQL database installed. What is the format of the source code files? Source code (Technical changes) are the set of XML files (model elements) onto your disk. Does AOS require to be running during development? Visual Studio user interface communicates with source files (XML files) with metadata API. When you build from Visual Studio, you are compiling into assemblies and other binaries that runtime. Through this whole process of development and build, you are working against files and as we all know Visual Studio works very weel with files so technically there is no need for AOS to be running during design and compilation. Is there any AOS service running anywhere for AX 7? No, there is no AOS service running into you box for AX 7, unlikely we have had in AX 2012. AOS service is actually a Web Service in IIS and there is a separate service for Batch processing in IIS called Microsoft Dynamics AX Batch Management Service. What is a Deployment Package? This is a compiled binary version of the model(s) and Package(s) that can be deployed to Cloud (UAT or Production). Once development or stage or development is complete and you are requires to moved these changes to UAT or to Production, this is where you create deployment package to move your changes. How X++ code is executed in AX 7? Executing X++ code, displaying a from, or running a report is integrated with Visual Studio debug (F5, Ctrl-F5) experience. This execution is through the AOS Web Application that is running into the local IIS. What is model element in AX 7? Model element (A Class, a table or a form) is simply an XML file sitting onto your disk and they are organized in folders per model. How Model, Package and a Project related in AX 7? Several models constitute a Package. A project always belongs to one model, it cannot belong to more than one model. Where does the Package sit in disk? Package are folders located in the model store folder of the Dynamics AX 7 Application. Packages can be seen from following path; Where does the model sit in disk? Model folders are contained in their Package folder. Each model folder contains type-specific folders, for example; all table in a model belong to the folder AxTable. Models can been seen from following path; What is a model descriptor? A Package folder contains a descriptor folder that lists all model that belong the package. A model descriptor file contains metadata about a model’s properties.  Why is there a need for Visual Studio for whole development? Visual Studio is simply a user interface on top of this architecture it allows you to be more productive and to only do things with the metadata that you are supposed to do instead of basically editing them in XML or in the text editor. Stay tuned! There is more to cover in future parts of this post… Happy Dax!ng…

Microsoft Dynamics 365 for Operations – How Packages and Models live in Visual Studio

In continuation of my previous post on few major technical changes in the world of AX 7, this post is all about to understand the core components of AX 7 development before we jump into AX development IDE in visual studio. Yes, we will write X++ code into Visual Studio by using four components. There are 4 main components to understand in Visual Studio include Elements, Models, Projects and Packages. To explore more let’s have a look at a screenshot of the Application Explorer. Within it, there is an AOT node. Model(s) and Packages(s) in Visual Studio environment I am gonna dig dipper into what Model and Package mean? Model: Model is a group of elements that represents the particular solution (Tables, Forms, and Classes e.t.c)  The definition of the Model is similar to what it was in AX 2012 (AX 2012 Models)  Model is a design time concept. For example A Fleet Management Model, A Project Account Model A Model may contains multiple Visual Studio projects. However, a project many only belong to one model All of the sub-nodes below the AOT node are different models, this is call Model View Package: A Package is a more of a compilation unit and distribution unit to move binaries and any other runtime artefacts that your model need between environments during the development ALM process. For example; moving them from the development box to the Cloud to run. A Package typically is one or more Packages typically packages into one we called deployment package and this is the unit that you use to move code to Cloud. A Package is a deployment unit that may contain one ore more models. In addition to elements, it includes more metadata, which is a description data that defines the properties and behaviour of the model. A Package can be exported into a file which can then be deployed into a staging or production environment.  Model in AX 2012 and in AX 7Model concept in AX 7 is quite similar to what it was in AX 2012. These are the source code so ISV distributing their solutions to partners or to customers are typically giving the models, they don’t provide Packages. They provide models that can be installed onto your box, customize them and the move them into your Cloud environment. Package in AX 2012 and in AX 7 In the AX 2012 world, Package is closer to what we used to call the model store to what we used to call the model files. Because you know they are pre-compiled things that you can deploy to a production or to UAT environment.  Visual Studio Project and Elements I am gonna dig dipper into what Project and Element mean? Visual Studio Projects Recommended way of development is to create Visual Studio project for all changes and the project always belongs to model, you can think of them is a subset of your model. Why do we have a different concept for model and project? The only reason we have two concepts of a model and a project is, typically AX 7 models are very large and its not a good practice to compile entire model for a simple code change activities during your development. Project always belongs to a particular model and is basically a subset of elements that belongs a model. One or more model can constitute a package, typically every package has one model. The reason sometimes we have one or more models in particular package when you customize during overlaying of source code. Elements Elements are AOT objects, for example; Base Enums, Extended Data Types, Tables, Classes, Forms, and Menu items and a lot more. Stay tuned! I will be posting more on how we can use these four components in real development. Happy Dax!ng

How to: Generate number sequence for new developed module in AX 2012

In this post I am going to create a number sequence for newly developed module in AX 2012.  1. Add a new element in NumberSeqModule baseenum with your new module name 2. Create a new Class NumberSequenceModuleModuleName extends NumberSequenceModule 3. Override loadModule method by adding the parameters of the sequence NumberSeqDatatype datatype = NumberSeqDatatype::construct(); //Message ID: MessageID is a new EDT of string type datatype.parmDatatypeId(extendedtypenum(MessageID)); datatype.parmReferenceHelp(literalstr(“MessageId”)); datatype.parmWizardIsManual(NoYes::No); datatype.parmWizardIsChangeDownAllowed(NoYes::No); datatype.parmWizardIsChangeUpAllowed(NoYes::No); datatype.parmSortField(2); datatype.addParameterType(NumberSeqParameterType::DataArea, true, false); this.create(datatype); 4. Override numberSeqModule method public NumberSeqModule numberSeqModule() { return NumberSeqModule::NewModule; } 5. Create new job to load number sequence static void MessageIDNumSeqLoad(Args _args) { NumberSeqApplicationModule::loadAll(); } 6. Go to Organisation Administration | Common Forms | Number sequences | Number Sequences | Generate and follow the wizard to end to generate number sequence for new module.

FaisalFareed@2025. All rights reserved

Design by T3chDesigns