Tuesday, March 30, 2010

SysSpellChecker

There is a class in AX that allows to perform spell checking. This class uses Microsoft Word spell checker to do the validation. So, in order to use it, Microsoft Word should be installed together with proofing language pack. Because of this requirement it is also important to consider where to run spell checking - on the server or on the client.

Example:
public static server void spellCheckerTest()
{
    SysSpellChecker sp = SysSpellChecker::newLanguageId('en-us');
    ;

    info(strfmt('%1', sp.checkSpelling("behavior")));
    info(strfmt('%1', sp.checkSpelling("behaviour")));
}


The output in infolog will be:
1
0

Upd: I've received a link to the interesting post where there is more information about AX spell checker - http://sangi1983.spaces.live.com/blog/cns!264A0056CBCBB1D3!404.entry?wa=wsignin1.0&sa=93421708

9 comments:

  1. Good One!!!
    I have elaborately written the code for spell checker to display the spellings using AX class or by using COM class we can still get the suggested spellings if it’s incorrect or not.

    AX Spell Checker Suggestion:
    http://sangi1983.spaces.live.com/blog/cns!264A0056CBCBB1D3!404.entry

    ReplyDelete
  2. I was really satisfy by your information. It's well-written, to the point, and relative to what I need. thank you for providing information on.
    AX Training | Dynamics AX Online Training

    ReplyDelete