Santosh. 的个人资料Dynamics Ax照片日志列表 工具 帮助

R Santosh.

职业
地点
兴趣
A Microsoft Certified Professional in Dynamics AX, Brain-bench Certified Professional in Networking Technologies

Microsoft Dynamics AX Community

Google Reader or Homepage

http://www.wikio.com
第 1 张,共 19 张
更多相册 (1)
11月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. 

11月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
11月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.
11月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.

11月2日

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.