Santosh.'s profileDynamics AxPhotosBlogLists Tools Help

Blog


    November 25

    My Blog - Microsoft Dynamics Related Community Site :) :) :)

     

    Today I received a mail from MS approving my AX Blog as a Microsoft Dynamics Related Community site. It gives me immense pleasure to announce you that my blog is a Microsoft Dynamics Related Community site. 

    My Microsoft Dynamics Related Community site can be viewed from the following link

    https://community.dynamics.com/content/axblogs.aspx?groupid=21

     

    Also a blog post is written introducing me to the MS community:

    https://community.dynamics.com/blogs/axnews/archive/2009/11/23/introducing-our-newest-ax-blogger.aspx

     

    Thank you to one and all for your constant support. 

    November 16

    Create/Delete Customer using AIF Service Class in Dynamics AX

     

    The Application Integration Framework allows us to create/update/delete or read data. Now in AX2009 we have a facility of creating/deleting records using AIF Service classes. There is "NO ADDITIONAL AIF SETUP"(Like Enabling Endpoints etc.) required to execute the code via service class. The services can be used to read/write data in AX.

    X++ service class job is illustrated below. 

    static void Services_CustTable_Create(Args _args)

    {

        // Customer Service class

        CustCustomerService     custService;

        CustCustomer                customer;

     

        // Data object of Service class

        CustCustomer_CustTable  custTable;

        AifEntityKeyList               entityKeyList;

        AccountNum                    accountNum;

        ;

     

        //Service instance

        custService =  CustCustomerService::construct();

     

        customer = new CustCustomer();

        customer.createCustTable();

        custTable = customer.parmCustTable().addNew();

     

        custTable.parmName("Cust_Service");

        custTable.parmCustGroup("20");

        custTable.parmCurrency("EUR");

        custTable.parmPartyType(DirPartyType::Organization);

     

        // Create Customer

        entityKeyList = custService.create(customer);

     

        if(entityKeyList)

            accountNum = entityKeyList.getEntityKey(1).parmKeyDataMap().lookup(fieldnum(CustTable, AccountNum));

            infolog.messageWin().addLine(accountNum);

    }

     

    static void Services_CustTable_Delete(Args _args)

    {

        AifEntityKeyList          entityKeyList;

        AifEntityKey               aifEntityKey;

       

        // Data object of Service class

        CustCustomerService     custService;

        CustTable                     custTable;

        ;

     

        aifEntityKey  = new AifEntityKey();

        entityKeyList = new AifEntityKeyList();

        custService   = CustCustomerService::construct();

     

        select firstonly custTable

            where custTable.Name == "Cust_Service";

     

        aifEntityKey.parmKeyDataMap(SysDictTable::getKeyData(custTable));

        entityKeyList.addEntityKey(aifEntityKey);

     

        try

        {

            // Delete Customer

            custService.delete(entityKeyList);

            info ("CustTable record was successfully deleted.");

        }

        catch(Exception::Error)

        {

            exceptionTextFallThrough();

        }

    }

    SO Creation:

     

    static void Services_SO_Create(Args _args)

    {

        // Sales Order Service class

        SalesSalesOrderService     salesService;

        SalesSalesOrder                salesOrder;

     

        // Data object of Service class

        SalesSalesOrder_SalesTable  salesTable;

        SalesSalesOrder_SalesLine    salesLine;

        AifEntityKeyList                   entityKeyList;

     

        SalesId                                salesId;

        ;

     

        //Service instance

        salesService =  SalesSalesOrderService::construct();

     

        salesOrder = new SalesSalesOrder();

        salesOrder.createSalesTable();

        salesTable = salesOrder.parmSalesTable().addNew();

        salesLine   = salesTable.createSalesLine().addNew();

     

        // Mandatory data filled for SalesTable

        salesTable.parmCustAccount("4000");

        salesTable.parmDeliveryDate(today());

        salesTable.parmPurchOrderFormNum('Test');

     

        // Mandatory data filled

        salesLine.parmItemId('B-R14');

        salesLine.parmSalesQty(1);

        salesLine.parmSalesUnit('Pcs');

     

        // Create Sales Order

        entityKeyList = salesService.create(salesOrder);

        if(entityKeyList)

            salesId = entityKeyList.getEntityKey(1).parmKeyDataMap().lookup(fieldnum(SalesTable, SalesId));

            infolog.messageWin().addLine(salesId);

    }

    So services could be used directly to invoke any AIF operation. hAPPy Dax-BinggggggSmile
    November 14

    Documentation resources for Microsoft Dynamics AX 2009

     

    The Technical white paper "Documentation resources for Microsoft Dynamics AX 2009" has been published. This white paper provides information about the documentation that is available for users, IT administrators, and developers.

     

    Download Center: http://www.microsoft.com/downloads/details.aspx?FamilyID=f4471844-dc4b-4e19-b2c9-c19442ab2991

     

    Customer Source: https://mbs.microsoft.com/customersource/documentation/whitepapers/ax2009_docresources.htm

     

     
    Technical white paper document provides the links on all of the following in a single click .

     

    • Documentation resource for users.
    • Documentation resource for IT Administrator.
    • Documentation resource for developers.
    November 11

    AX Spell Checker Suggestion

     

    “SysSpellChecker” as the name suggest checks the spelling mistake and provides you with the list of spellings that may be useful or applicable.

    Sample job is illustrated using SysSpellChecker class. AX spell checker class is integrated with Word where methods like below are provided by COM classes.

    ·         activeSpellingDictionary

    ·         Checkspelling

    ·         getSpellingSuggestions

    static void SysSpellChecker_AX(Args _args)

    {

        SysSpellChecker    sysSpellChecker;

        container             spellings;

        ListEnumerator    listEnumerator;

        List                     spellingsSuggestions;

        int                       i;

        ;

     

        spellings = ['Tble', 'Comput', 'Mcrosft', 'Rlease'];

     

        // Get AX --> Current Language id

        // Construct the sysSpellChecker object.

        sysSpellChecker = SysSpellChecker::newCurrentDocumentationLanguage();

     

        startLengthyOperation();

     

        for(i=1; i<= conlen(spellings); i++)

        {

            if(! sysSpellChecker.checkSpelling(conpeek(spellings, i)))

            {

                spellingsSuggestions = sysSpellChecker.getSpellingSuggestions(conpeek(spellings, i));

                listEnumerator         = spellingsSuggestions.getEnumerator();

     

                while(listEnumerator.moveNext())

                {

                    print "Suggested Spellings are:" + listEnumerator.current();

                    pause;

                }

            }

        }

        sysSpellChecker.finalize();

     

        print "Your done with Spell check.";

        pause;

     

       endLengthyOperation();

    }

     

     Above example is shown using AX class. But using COM class we can still get the suggested spellings if it’s incorrect.

    static void SpellChecker_COM_Word(Args _args)

    {

        System.Globalization.CultureInfo cultureInfo;

     

        COM                              wordDocs;

        COM                              languages, language;

        COM                              dictionaries;

        COM                              word;

        COM                              languageDictionary;

        COM                              customDictionary;

        COM                              suggestionsObj;

        COM                              suggestion;

     

        List                               suggestions    = new List(Types::String);

        ListEnumerator              listEnumerator;

     

        int                                  lines = infolog.line();

        int                                  languageId;

        int                                  i;

     

        Session                          session = new Session(sessionid()) ;

     

        void initDictionary(LanguageId _language)

        {

            Set dictionary;

            ;

     

            dictionary = new Set(Types::String);

     

            dictionary.add('Axapta');

            dictionary.add('MorphX');

            dictionary.add('Microsoft Dynamics AX');

            dictionary.add('Damgaard');

            dictionary.add('nbsp');      //HTML nonbreakable space

     

            if (_language == 'En-Us')

            {

                //Often used words added to speed up checking

                dictionary.add('is');

                dictionary.add('isn');

                dictionary.add('has');

                dictionary.add('hasn');

                dictionary.add('was');

                dictionary.add('wasn');

                dictionary.add('then');

                dictionary.add('a');

                dictionary.add('in');

                dictionary.add('the');

                dictionary.add('this');

                dictionary.add('not');

                dictionary.add('can');

            }

        }

     

        cultureInfo  = new System.Globalization.CultureInfo(session.interfaceLanguage());

        languageId  = cultureInfo.get_LCID();

     

        if (!word)

        {

            try

            {

                word = new COM('Word.Application');

            }

            catch (Exception::Internal)

            {

                infolog.clear(lines);

                throw error("@SYS74320");

            }

        }

     

        //Need to add a document or else Word97 will fail

        //the calls to Application.GetSpellingSuggestions

        wordDocs = word.documents();

        wordDocs.add();

        word.windowState(0);

        initDictionary(session.interfaceLanguage());

     

        try

        {

            languages                 = word.languages();

            language                  = languages.item(languageId);

            languageDictionary   = language.activeSpellingDictionary();

            dictionaries              = word.customDictionaries();

            customDictionary      = dictionaries.activeCustomDictionary();

     

            suggestionsObj         = word.getSpellingSuggestions('Speling',

                                                                                        customDictionary,

                                                                                        languageDictionary);

            for (i=1; i<=suggestionsObj.count(); i++)

            {

                word.checkspelling('Speling', customDictionary, true, languageDictionary);

                suggestion = suggestionsObj.item(i);

                suggestions.addEnd(suggestion.name());

            }

     

            listEnumerator = suggestions.getEnumerator();

            while(listEnumerator.moveNext())

            {

                print "Suggested Spellings are:" + listEnumerator.current();

                pause;

            }

     

            word.quit();

        }

        catch (Exception::Internal)

        {

            infolog.clear(lines);

            throw error(strfmt("@SYS84011", session.interfaceLanguage()));

        }

    }

     

    Happy Spell check dAXing.

    November 02

    What is the “Message Limit Of INFOLOG” in Dynamics AX?

     

    AX Developers just play around with infolog framework provided by Microsoft. But did we ever know what the maximum limit which an infolog can hold? Well… The answer is quite simple.

    Quick Lab:

    69320408.png

    Run the following job and it would result in the following warning: “The number of messages exceeds the limit of the Infolog (10000.)”

    So maximum “MESSAGE LIMIT OF THE INFOLOG” in AX is 10000(By Default). But wait!!!!!! you can still increase this limit of an infolog???SmileBy increasing the local constant available inside the info-class in the method viewBuild (first line). (i.e. #define.MaxErrors(10000))

    These messages is generated during the build of the tree, the rest of the Infolog-messages will be skipped, but are available in the temptable sysinfolog. There is another limit, errorsPerBatch, an info-method too, this limit will be checked every time you add a message to the Infolog AND during the build of the tree.

    October 28

    Difference b/w SELECT AND FIELDSELECT in Dynamics AX

     

    Hi,  

    X++ contains special language feature (i.e. embedded SQL).So we use select query in X++ directly to fetch/retrieve data.

    SELECT in Dynamics AX can be distinguished into two types.

    ·         normal Select

    ·         field Select

    There is a difference between a normal select statement and a field select statement:

    field select statement

                   normal select statement

    This operates directly on a table. So table buffer need not be instantiated.

    This operates on a table buffer variable. So table buffer should be instantiated.

    Only the particular field is selected from the table.

    Whereas in normal select, entire table fields are selected.

    SQL statement:

    (CustTable) SELECT A.ACCOUNTNUM, A.RECID FROM CUSTTABLE A WHERE (DATAAREAID=?) ORDER BY A.DATAAREAID,A.ACCOUNTNUM [ID=11910, Reused=Yes]

    SQL statement:

    (CustTable) SELECT TOP 1 A.ACCOUNTNUM,A.NAME,A.ADDRESS,A.PHONE,A.TELEFAX,A.INVOICEACCOUNT,

    A.CUSTGROUP,A.LINEDISC,A.PAYMTERMID,A.CASHDISC,A.CURRENCY,

    A.INTERCOMPANYAUTOCREATEORDERS,A.SALESGROUP,

    A.BLOCKED,A.ONETIMECUSTOMER,A.ACCOUNTSTATEMENT,

    A.CREDITMAX,A.MANDATORYCREDITLIMIT,

    A.DIMENSION,A.DIMENSION2_,A.DIMENSION3_,A.VENDACCOUNT,

    A.TELEX,A.PRICEGROUP,A.MULTILINEDISC,A.ENDDISC,

    A.VATNUM,A.COUNTRYREGIONID,A.INVENTLOCATION,

    A.DLVTERM,A.DLVMODE,A.MARKUPGROUP,A.CLEARINGPERIOD,

    A.ZIPCODE,A.STATE,A.COUNTY,A.URL,A.EMAIL,A.CELLULARPHONE,

    A.PHONELOCAL,A.FREIGHTZONE,A.CREDITRATING,A.TAXGROUP,

    A.STATISTICSGROUP,A.PAYMMODE,A.COMMISSIONGROUP,

    A.BANKACCOUNT,A.PAYMSCHED,A.NAMEALIAS,A.CONTACTPERSONID,

    A.INVOICEADDRESS,A.OURACCOUNTNUM,A.SALESPOOLID,A.INCLTAX,

    A.CUSTITEMGROUPID,A.NUMBERSEQUENCEGROUP,A.LANGUAGEID,

    A.PAYMDAYID,A.LINEOFBUSINESSID,A.DESTINATIONCODEID,

    A.GIROTYPE,A.SUPPITEMGROUPID,A.GIROTYPEINTERESTNOTE,

    A.TAXLICENSENUM,A.WEBSALESORDERDISPLAY,A.PAYMSPEC,

    A.BANKCENTRALBANKPURPOSETEXT,A.BANKCENTRALBANKPURPOSECODE,

    A.CITY,A.STREET,A.PAGER,A.SMS,A.INTERCOMPANYALLOWINDIRECTCRE80,

    A.PACKMATERIALFEELICENSENUM,A.TAXBORDERNUMBER_FI,

    A.EINVOICEEANNUM,A.FISCALCODE,A.DLVREASON,

    A.FORECASTDMPINCLUDE,A.GIROTYPECOLLECTIONLETTER,

    A.SALESCALENDARID,A.CUSTCLASSIFICATIONID,A.INTERCOMPANYDIRECTDELIVERY,

    A.ENTERPRISENUMBER,A.SHIPCARRIERACCOUNT,A.GIROTYPEPROJINVOICE,

    A.INVENTSITEID,A.ORDERENTRYDEADLINEGROUPID,A.SHIPCARRIERID,

    A.SHIPCARRIERFUELSURCHARGE,A.SHIPCARRIERBLINDSHIPMENT,

    A.PARTYTYPE,A.PARTYID,A.SHIPCARRIERACCOUNTCODE,A.PROJPRICEGROUP,

    A.GIROTYPEFREETEXTINVOICE,A.SYNCENTITYID,A.SYNCVERSION,A.SALESDISTRICTID,

    A.SEGMENTID,A.SUBSEGMENTID,A.RFIDITEMTAGGING,A.RFIDCASETAGGING,

    A.RFIDPALLETTAGGING,A.COMPANYCHAINID,A.MAINCONTACTID,A.COMPANYIDSIRET,

    A.COMPANYIDNAF,A.IDENTIFICATIONNUMBER,A.PARTYCOUNTRY,A.PARTYSTATE,

    A.ORGID,A.PAYMIDTYPE,A.FACTORINGACCOUNT,A.PBACUSTGROUPID,

    A.MODIFIEDDATETIME,A.CREATEDDATETIME,A.RECVERSION,

    A.RECID, A.MEMO FROM CUSTTABLE A WHERE ((DATAAREAID=?)

    AND (ACCOUNTNUM LIKE? ESCAPE '\' )) [ID=11873, Reused=Yes]

     

    Example:

    Sample job is illustrated above. Have a hAppYyYyYyYyYy dAxzinggggggggg Angel emoticon

    October 16

    Get File Encoding in Dynamics AX using X++

     

    Hi All,

    Recently there was an interesting query from one of the technical forum.

    Publisher: http://objectmix.com/axapta/789064-get-file-encoding.html

    Question: How to get encoding file format from xml in Dynamics AX?

    Answer: I have created a small class which would retrieve the encoding format of an Xml.

    Approach Followed:

    ·         Class receives input file as string.

    ·         Based on the input file, the XmlReader is initialized.

    ·         Xml is read using read () method from XmlReader

    ·         When xmlReader.name () is equal to the XmlEncodingAttribute then encoding format is returned.

    Path: http://cid-264a0056cbcbb1d3.skydrive.live.com/self.aspx/.Public/Class%5E_RetriveXMLEncodingFormat.xpo

    Second part of question is possible convert it to ANSI before reading?

    Instead of trying to convert a file in ANSI it would be better we use Binary class to read and write data in the binary format even though if there is special character in the file.  Since reading with ASCIIIO will only support NON ASCI character so binary is the better option.

    Here is the sample example using BinData kernel class:

    Happy DaxingggggggggLeft hugRight hug

    October 01

    Conduit - Customize Your Own Toolbar

     

    Note: Please feel free to use them for your own use with discretion.

     

    Hi All

    I have become a user in Conduit!

    Well what is Conduit?

    It’s a free website which allows creating/customizing your own Toolbar. So we can create our own free custom toolbar and stay connected to users even if they are surfing other website.

    I have created my own toolbar for Dynamics AX which has my blog link as AX icon  at the extreme left corner of the toolbar. Here is the sneak-peak of the toolbar which I have designedJ

     

    You can also download my Toolbar for your IE or any other browser from the following link

    http://dynamicsax.ourtoolbar.com/

     

    Having your own toolbar is always a joy J Why can’t we have it one? Happy dAXinG..................................Smile

    September 29

    How to Display Table,Query field value in Xml.

     

    Hi Everyone,

    In table, query, view we have a system method as xml () which is used to display field value in Xml.  The structure of table/query is created as Xml. This method gives you the feasibility of populating the fields directly in xML without actually using the xML Classes available in AX.

    Please find the following examples below:

    Using Table:

    static void TableFieldsAsxML(Args _args)
    {
        #define.CustAccountNum('4000')
        #AOT
        #define.xmlFileName('.xml')

        CustTable   custTable;
        XmlDocument xmlDocument;
        str         _xml;
        ;

        xmlDocument = new XmlDocument();

        select firstonly custTable
            where custTable.AccountNum == #CustAccountNum;

        _xml = custTable.xml(1);
        xmlDocument.loadXml(_xml);
        xmlDocument.save(WinApi::getTempPath() +
                                         #AOTDelimiter +
                                         strins(strrem(xmlDocument.name(), '#'), #xmlFileName, strlen(xmlDocument.name()) + 1));
    }

     
    Using Query:
     

    static void QueryAsxML(Args _args)
    {
        #AOT
        #define.xmlFileName('.xml')
        #define.CustAccountNum('4000')

        Query                q;
        QueryRun             qr;
        QueryBuildDataSource qbd;
        QueryBuildRange      qbr;
        XmlDocument          xmlDocument;
        str                  _xml;
        ;

        q = new Query();
        qbd = q.addDataSource(tableNum(CustTable));
        qbr = qbd.addRange(fieldNum(CustTable, AccountNum));
        qbr.value(#CustAccountNum);
        qbd.addSortField(fieldNum(CustTable, Name));
        qr = new QueryRun(q);
        xmlDocument = new XmlDocument();
        _xml = q.xml(1);
        xmlDocument.loadXml(_xml);
        xmlDocument.save(WinApi::getTempPath() +
                                         #AOTDelimiter + 
                                         strins(strrem(xmlDocument.name(), '#'), #xmlFileName, strlen(xmlDocument.name()) + 1));
    }
    33232781.jpg
     
    This way you can use the system xml() function view a given file in xml.
    September 18

    AX Add-ins

     
    Coming Soon..................................
     
    Add-ins which are useful to Developer
     
    1) Listing Mandatory Fields in tables without actually traversing to AOT.
     
    2) AOT Browser - Without Manual UI Interaction.Sarcastic
     
    September 09

    Error occurred executing stored procedure when creating session for the AOS

     

    Please Note:  All this code snippets are a result of some development that came up from time to time. Please feel free to use them for your own use with discretion.

     

    In AX2009 I tried manually creating DB and pointing Dynamics server to the created DB. When trying to start the AX services I ended up facing following errors.

    err100.jpg

     

    On viewing the event viewer under Application you will clearly see there is a login failure issue

    even.jpg 

    So you need to manually change the log on password under Dynamics AX service properties. Again when AX service was restarted there was another error.

    err100.jpg

     

    In the event viewer you’ll see the following error

    eves.jpg 

    What is the error all about?

    When AX is installed through setup.exe, stored procedures are internally created for the Database. The two stored procedures that gets created are

    ·         CREATESERVERSESSIONS

    ·         CREATEUSERSESSIONS à This creates the User Session

    So when DB is created manually in SQL, the stored procedure is not available because of which AX service is not started successfully.

     

    Solution:

    For the DB which are created manually make sure you create the stored procedure successfully in order to point to AX server.

     

    STORED PROCEDURE FOR CREATESERVERSESSIONS

    http://cid-264a0056cbcbb1d3.skydrive.live.com/self.aspx/.Public/CREATESERVERSESSIONS.sql
     

    STORED PROCEDURE FOR CREATEUSERSESSIONS

    http://cid-264a0056cbcbb1d3.skydrive.live.com/self.aspx/.Public/CREATEUSERSESSIONS.sql 

     

    Run the stored procedure SCRIPTS and then try to restart AX service. You’ll successfully be able to point to the newly created Database.

    July 15

    AIF Outbound Setup in AX2009

     

    Usage of AIF in AX is increasing day by day. I have taken the pain of explaining the outbound setup process in AIF using File System Adapter.

    Path to Download the Setup:

    http://cid-264a0056cbcbb1d3.skydrive.live.com/self.aspx/.Public/AIF%7C_Ax2009.docx

    This document explains in depth process involved for configuring AIF. AIF in comparsion to AX2009 with AX40 has improved features.

    ·         Actions which were used in AX40 is now scrapped in AX2009 and is completely dealt with web service

    ·         Create; read, update, and delete (CRUD) operations are now supported.

    ·         The programming model for AIF supports document services that encapsulate business logic and are the interface to external systems.

    ·         AIF provides functionality for consuming external Web services from within X++.

    ·         Performance improvements include the ability to scale up and handle more messages through parallel message processing and the addition of multiple AOSs.

    ·         New document services for additional commonly-used documents.

    The AIF architecture showing the transport layers above and the business logic layers below.

    AIF Architecture

    Consuming Web Services in Microsoft Dynamics AX 2009 White Paper (By Sanjay Jain)

    http://www.microsoft.com/downloads/details.aspx?FamilyID=ef3a50d2-61c8-4ffc-bce8-2caf038f98cd&displaylang=en

    Microsoft Dynamics AX 2009 Server and Database Administration Guide

    http://www.microsoft.com/downloads/details.aspx?FamilyId=E7BFB7A8-EB99-4171-B75A-D9A37067BC19&displaylang=en#filelist
    The above link explains the BATCH CONFIGURATION FOR AIF.

    In future I would also be adding the process involved for Configuring and Processing Inbound through AIF Surprised

    July 09

    Enable/Disable keys using Task Macro in Dynamics AX

     

    Hi,

     

    Back again with one more small trick J. How to restrict access for users  perform any task on AX forms? I tried implementing this using Task macro.  Here is the detailed procedure for it.

     

    In AOT Task Macro (\Macros\Task)

     

    ·         Define Task-ID values, to be used with form Control’s

    34080536.jpg

     

    Note: To know any task id in AX. Put the debugger in the \Classes\SysSetupFormRun\task and observe the watch window for the value of _p1 (task id)

    ·         Now place the following code in \Classes\SysSetupFormRun\task before super() call

     

               //Disable Hide/Setup/Go to Main Table Task

                if (_p1 == #taskFilterHide || _p1 == #taskFilterSetup || _p1 == #taskMainTable)

               {

                         Box::info ("@SYS81158", strfmt ("@SYS72189"));

              

                         if (DialogButton::Ok)

                                    return 0;

               }

              

               90724390.jpg

     

    Now if any of above action is performed then user will end up seeing no access rights Embarrassed.

     

     

    July 01

    Error: Cannot execute a data definition language command on ().

     

    Hi All,

                      I would like to share a job which i found in a technical forum. Most of us would have ran into issue "SQL database error" when data is loaded in Dynamics AX. In order to fix it please run through the job found in the attached link.

     
     

    Happy dAxInG................Smile

    June 18

    Configuration Key Status Using X++ Code

     

    As we are aware, Configuration key controls access to specific feature. To know about the status of a configuration key, the user has to traverse Administration->Setup->System-> Configuration.

    Instead with the following job, a user can know the status of all the configuration keys that is being used in the system.

     

    //Configuration key names and their enable state.

    static void ConfigurationKey(Args _args)

    {

        ConfigurationKeySet   configKeySet;

        DictConfigurationKey  dictConfigKey;

        Object                         formRun ;

        Map                             mapConfigKey;

        str                                strOutput;

        int                                i;

        ;

     

        mapConfigKey = new Map(Types::Integer, Types::String);

        configKeySet = new ConfigurationKeySet();

        configKeySet.loadSystemSetup();

     

        for (i=1; i <= configKeySet.cnt(); i++)

        {

            dictConfigKey = new DictConfigurationKey(configKeySet.cnt2Id(i));

            strOutput     = dictConfigKey.enabled() ? "enabled:" : "disabled:";

            strOutput    += " " + " " + dictConfigKey.name();

            mapConfigKey.insert(i, stroutput);

        }

     

        _args = new Args(formstr(SysPick));

        _args.parmObject(mapConfigKey);

     

        formRun = classfactory.formRunClass(_args);

        formRun.init();

        formRun.run();

     

        formRun.setCaption('ConfigurationKey Status');

        formRun.wait();

    }

    20851015.jpg

    On executing this job, the output will be displayed in a SysPick form

    June 15

    Validating TabPage Fields Dynamically

     

    This article is to my lovable sweetheart AnithaSantosh.

    I would like to share a small piece of information on validation stuff at form level. The requirement is something like doing basic validation. All fields at the form level needs to be filled in; else it needs to update the user that the specific fields’ information is missing.

    All the field validation is basically done at the table validate Field method. If the form design is changed time to time then the code also needs to be updated which isn’t a good practice.

    I took a small example to showcase how we can achieve the requirement.

    I have custTable form which maintains customer details and payment is important information which is required when we make any sales order. If the basic payment information is not filled in while creating customer details then system has to update the user that all details under payment tab needs to mandatorily filled in.

    1) Set Auto declaration to ‘Yes’ for payment Tab under custTable form design

    2) Under validateWrite of the custTable datasource add the following logic.

        for (i=1; i<= payment.controlCount (); i++)

        {

            if (payment.controlNum (i).valueStr () == '')

            {

                warning (strfmt ("%1, %2, %3", i, strdel (payment.controlNum (i).name (), 0, 8), 'Mandatory to be filled in.'));

            }

        }

    So basically before the Cust details are saved it checks whether all fields under payment Tab is filled else it will throw warning will the furnished details.

    63952849.jpg

    Note: No. indicates fieldNum

    This is just a basic information which i felt would be useful tip Smile Happy Daxingggg Hot

     
    May 25

    Inside Microsoft Dynamics AX 2009 - Released

     

    A big Thanks to MFP and Arjit for their contribution on the release of latest edition on "Inside Microsoft Dynamics AX 2009".

    To Download Code Samples: http://www.microsoft.com/learning/en/us/book.aspx?ID=13345&locale=en-us#tab2

    Happy DAx Learning.................................

    May 22

    SalesTaxGroup Defaulting Issue in AIF 2009

     

    I have seen a strange behaviour in AX 2009. While processing vendor records via AIF the corresponding sales tax group doesn't default in the vendor master. VendGroup master table has default tax group setup done as shown

     When “Vend Group” is passed via Xml accordingly the related fields needs to get defaulted. Screenshot on the same is shown. 

    Reason: There is no defaulting logic implemented in the setTaxGroup () method in the AxVendTable class.

    Solution: The setTaxGroup () method needs to implemented with the following logic after isMethodExecuted called.

    The setTaxGroup () method needs to implemented with the following logic after isMethodExecuted called.

    //Checks if VendGroup is provided in Xml.

    //If no VendGroup then it throws error stating mandatory field missing.

    this.setVendGroupFields ();

     

                    //Checks if <VendGroup> field is set in the Xml

                    //And check if the vendor group master has TaxGroupId defined for it.

    If (this.isFieldSet (fieldnum (VendTable, VendGroup)) &&

                                    this.vendGroupRecord ().TaxGroupId)

                    {

                                    this.parmTaxGroup (this.vendGroupRecord ().TaxGroupId);

                    }

     

    With the following piece of code the sales tax group will be defaulted in the vendor master details.  Even Customer master has similar issue and i assume Microsoft would either release a hot fix for AX2009/resolve the bug in vNextSmile

    May 18

    Editor Scripts - New Addins

     

    I have developed few interesting add-ins for Dynamics AX as a part of my project requirement. This tool would be useful especially for AX Developers.

    The tool is basically an extension in the Editor scripts class.

    ShowSysFuntions:  It is used to show details of sysFunction in Microsoft Dynamics AX. In order to know significance of a particular function the developer needs to traverse through SysDocumentation\Functions each time. Functions help is displayed in a help browser just like the in-built functions in Dynamics AX.

     

    SysFunction Sneak Peak Video:

     

          

     

     The second Editor Script is using the SysDictClass methods

    a) Extend

    b) Extended By

     

    Extend:  Provides the ID for the class that a specified class extends.

     

    ExtendedBy:  Provides a List Class object for the classes that extend a specified class.

     

    Example: Take SalesFormLetter_Invoice class. It gives list which gets inherited from these classes.

     

    Example: Take the same SalesFormLetter_Invoice class. It would provide details of the child class which is extending this class.

     

     

    May 12

    Microsoft Dynamics AX 2009 Enterprise Portal Deployment

     
    Thanks to Mey for providing an opportunity to join an administrator oriented Deployment and Setup discussion on Enterprise Portal for Microsoft Dynamics AX 2009.
    In his own words
    "This session provides deep insight into the EP deployment process, what goes behind the scene for EP Setup program and some key "how-to" points on deploying and setting up EP, understanding the infrastructure, etc."
     
    Screencast is posted on