Table Indexes - Dynamics AX

| No Comments | No TrackBacks
Been a while since I have created a table and this came to mind as I was clearing some best practices after creating one. There is no BP check for this, but one of the most frequent complaints from DBA's and potential performance impacts we make is forgetting to leverage indexes or at least create them. It may seem parameter, temp and working tables don't really need an index, but as a rule create one for every table.

Here is an easy way to create an "if nothing else" index.

1. Set the CreateRecIdIndex to Yes
2. Save the table
3. Set the Primary and Cluster Index to RecId

I had a could things I needed for a project that weren't standard in the functions list. I googled around and snagged some java script code that works just fine and made a custom function that I reuse across many of my projects. Here is a quick tutorial and example of code.


1. Create a new custom function.


2. Give the custom function a name. There is no input parameter required


3. Enter the code as shown below, which will return a valid guid to any string variable.



var s = [], itoh = '0123456789ABCDEF';

  for (var i = 0; i <36; i++) s[i] = Math.floor(Math.random()*0x10);

  s[14] = 4;
  s[19] = (s[19] & 0x3) | 0x8;

  for (var i = 0; i <36; i++) s[i] = itoh[s[i]];

  s[8] = s[13] = s[18] = s[23] = '-';

  return s.join('');

Visitors - Dynamics AX

| No Comments | No TrackBacks
Hello to anyone visiting,

I was looking through some logs and noticed a few request for articles, tutorials and files that I had on the site previously. I removed these and decided to use a packaged CMS system instead of my custom built one. I apologize for this, I did some searching and found links and articles referring to my site, I have to admit it made me smile. I will be republishing the pages and files under a new category and placing redirects on the previous pages. Thank you for visiting and feel free to contact me if there is anything you need but don't find.


Webservice Return Msg - Dynamics AX

In the CustomerService webservice class CustCustomerService the update service doesn't return a value. This means any programming consuming this service can not wait for a return to verify the call was successful. The create service does return a value, so you can piggy back off this same methodology. It is possible this is corrected in more recent roll ups, as I believe my system is still on RU1.

Original Code - As you see there is no return value, thus no way to make your service monitor for success.
public void update(AifEntityKeyList _entityKeyList, CustCustomer _custCustomer)
this.updateList(_entityKeyList, _custCustomer);

Modified Code - Below I have changed the structure slightly to follow the create structure. I added a local copy of the method UpdateList from class AifDocumentService to the CustCustomerService class and change it slightly to return the aifEntityKeyList.
public AifEntityKeyList update(AifEntityKeyList _entityKeyList, CustCustomer _custCustomer)
return this.updateListReturn(_entityKeyList, _custCustomer);
Local modified AifDocumentService UpdateList method
protected AifEntityKeyList updateListReturn(AifEntityKeyList entityKeyList, AifDocument document)
    AifResult aifResult;
    AxdBase axdBase;
    AifEndpointActionPolicyInfo endpointActionPolicyInfo;

    if (entityKeyList == null)
        throw error(strfmt("@SYS91439", 'entityKeyList'));

    if (document == null)
        throw error(strfmt("@SYS91439", 'document'));

    axdBase = document.getAxdInstance();
    endpointActionPolicyInfo = this.getEndpointActionPolicy(document);


    constraintListCollection = new AifConstraintListCollection();

    aifResult = axdBase.updateList(entityKeyList, document.serialize(), endpointActionPolicyInfo, constraintListCollection);
    correlationEntityKeys = aifResult.parmEntityKeyList();

    return correlationEntityKeys;

Implementation - Complete - Dynamics AX

| No Comments | No TrackBacks
The title may be somewhat of a lie, but it's a hell of an accomplishment to have synced that many accounts in a weekend. In total I have 107,000 accounts now synced and syncing future updates live.

I consider this a pretty big milestone, this is a system I have been working on for a very long time. Many 130+ hr/weeks and I had some home issues during the process, but here I am looking at the end of phase one.

MS Dynamics AX: Amazing internal ERP system, I've been programming this application for 5 years and love every minute of it.

Cast Iron Systems: Excellent mechanism for connecting disparent systems and just making complex stuff easy in general.

salesforce-logo.jpg While I personally would have built our system using enterprise portal to expose MS Dynamics, Salesforce is a very nice CRM system. Its' API is easy to work with and as the market leader in cloud CRM it is very well documented and robustly integrated.


More MS Dynamics AX Entries

More CastIron Entries