Microsoft Dynamics 365 for Operations – Number sequence
Number sequence framework in there for a while with the release of AX 2012 however, with the arrival of D365 we need to make a small addition on top of what we have been doing in AX 2012. Following my previous, post How to generate number sequence for new module in AX 2012 all steps remain same as summarizing below to generate number sequence for the newly developed module. 1. Create a new class similar to NumberSeqModuleCust but suffix it with your module name e.g. NumberSeqModuleMyModule extended from NumberSeqApplicationModule 2. Added loadModule() method 3. Add numberSeqModule() method with your new added enum value (for your module) in NumberSeqModule_extension (You should create an extension of NumberSeqModule base enum and not customizing it and add new element for your module into that extension) 4. This is an additional step for D365 you would need to perform otherwise it will claim “The value does not exist in the map”. Create a new delegate method to class NumberSeqGlobal which will append the current class to the map that links modules to number sequence data type generators. [SubscribesTo(classstr(NumberSeqGlobal),delegatestr(NumberSeqGlobal,buildModulesMapDelegate))] static void buildModulesMapSubsciber(Map numberSeqModuleNamesMap) { NumberSeqGlobal::addModuleToMap(classnum(NumberSeqModuleMyModule), numberSeqModuleNamesMap); } 5. Continue with executing the job to loadAll numberSequences and Generate it from Organization module as mentioned in previous post
Microsoft Dynamics 365 for Operations – Selecting a correct form pattern
Selecting an appropriate form pattern has never been that easy. https://ax.help.dynamics.com/en/wiki/how-to-select-a-form-pattern/ This explains, which form pattern will suit your requirements with examples where your to be selected form pattern has been used in the application.
MS D365 – Development Exam – A brief outlook
Having passed the Microsoft Dynamics 365 Development Introduction exam (MB6-890), here are few thoughts on the exam which might help someone who is planning to appear in this exam. If you are an experienced AX developer and have worked on AX 2012 – you don’t need to worry. Having said this “You don’t need to worry”, It would be the wiser step to watch all videos from https://mbspartner.microsoft.com/AX/CourseOverview/1181. You can visit the Microsoft Dynamics Learning Portal and access it via your CustomerSource Account or PartnerSource Account. The exam will consist of 90 Questions and you will have 115 minutes to complete. Brief outlook of the exam; 1. Basic X++ knowledge – For , do…while and while loops understanding and code flow 2. Extended data types – what properties can be extended from parent EDT 3. Menu item properties – key properties of menu items 4. Types of menu items and which one used for what purpose 5. Base enumeration – how these get stored in database 6. Table relationship and indexes 7. Class inheritance – spend more time on this topic (worth to read https://ax.help.dynamics.com/en/wiki/xpp-classes-and-methods/) 8. Best practices and advantages of creating labels instead hard code text 10. Understand Application stack and Server architecture 11. Update model dependencies 12. Check Break statement in switch cases 13. Exception handling 14. How to check properties of an element in Visual Studio 15. Security structure in AX 16. Form Patterns https://ax.help.dynamics.com/en/wiki/how-to-select-a-form-pattern/ 17. See ttsbegin and ttsCommit statement in insert statements 18. Naming convention – check camelCase naming convention 19. How to configure build option in Visual Studio 20. Projects, model and Packages 21. Use of resources Additionally and the most important step towards success is; Download D365 virtual machine (link) and practice with creating a small project. This really gives you hands-on experience rather purchasing dumps. Get yourself registered for the exam; https://www.microsoft.com/en-sa/learning/exam-mb6-890.aspx For list of Microsoft Dynamics Certifications https://www.microsoft.com/en-sa/learning/dynamics-certification.aspx Finally, If you ever need any help from my side please feel free to contact me. Wish you best of luck!!! Happy Dax!ng
MS Dynamics 365 – Create Model and Project – Development Part 1
This post describes how to create model with correct selection of package which leads to correct development approach either Extension or Overlayering (Customization) Go to Dynamics 365 or AX7 | Deploy | Create model Enter required information as shown Choose correct package If you decided to go with overlayering, existing package will be selected from dropdown. Select referenced packages For this example; I will go with extension development approach, it is easy to upgrade with new versions or updates coming from MS. Marked all required packages (models) which can be referenced through your new created model. Through these references, you can actually use the element living in those packages (models), without these references you cannot access any element belongs to a different model. Lets’ say you want to access CustTable which belongs to Application Suite package then you have to checked Application Suite package in referenced package list. Create model Summary Create new project option will open a new window where you can put the project name linked with this model. NOTE: A project can only be linked with one model Project created in Visual Studio Update model parameters You may require updating model parameters by adding more reference packages. This can be done as follows; Select model name to update Add or remove reference packages Click Next will take you model summary screen and will update the project in Visual Studio with updated references.
MS Dynamics 365 – Configure Visual Studio for better expereince
Few settings to configure in Microsoft Visual Studio to make the development experience with AX a little smoother. Go to Dynamics 365 Options Set Projects Options – organize project by element type Set Text Editor Options – Line number and word wrap Set Best practice options The definition of best practice rules set is per model, by default it is set to Application Common model and can be switched between the different model from the combo box in the upper right corner. For example; to work with Customization Analysis you have to check Microsoft.Dynamics.AX.Framework.CustomizationAnalysisRules best practice rule. Build process itself does BP checking – there is an option to enable it. [To take into effect you might have to rebuild the solution/project in contrast to we usually do – build].
MS Dynamics 365 – Configure Visual Studio for better expereince
Few settings to configure in Microsoft Visual Studio to make the development experience with AX a little smoother. Go to Dynamics 365 Options Set Projects Options – organize project by element type Set Text Editor Options – Line number and word wrap Set Best practice options The definition of best practice rules set is per model, by default it is set to Application Common model and can be switched between different models from the combo box in the upper right corner. Let’s say if you are working with Customization Analysis you have to check Microsoft.Dynamics.AX.Framework.CustomizationAnalysisRules best practice rule. Set BP rules at Build level Build process itself does BP checking – there is an option to enable it. To take this into effect you might have to rebuild the solution/project rather build it.
AX 2012: How to use JumpRef method
JumpRef method is mostly used with fields which are not linked with an EDT however, this depends on the design of the code and the requirement. I got a requirement to show ‘View Details’ options to the field of type notes (memo). There can be multiple ways to accomplish it but its always better to have your code at a central location (best to have it in Class or at table level) to reuse it. JumpRef method can be overridden at form level under control itself but we are not going to do [avoid code changes at form level] Better to override JumpRef method at datasource field level and call method from table. JumpRef Method: public void jumpRef() { JumpRef::peformJumpRef(JumpRef.Notes); } PerformJumpRef method at table static void peformJumpRef(Notes _notes) { MenuFunction menuFunction; Args args = new Args(); DocumentNotes documentNotes; // This is the table of the master where view details option will take you. Change table name here, this is just for sample ; if (_notes) { documentNotes = DocumentNotes::find(_notes); } args.record(documentNotes); args.lookupRecord(documentNotes); menuFunction = new MenuFunction(menuitemDisplayStr(DocumentNotes), MenuItemType::Display); menuFunction.run(args); }
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”