Thursday, December 14, 2006

VendAccountItemLookup Form


During our implementation, one of the engineers on our functional team brought it to my attention that a particular lookup did not show vendor names next to their account numbers and the lookup needed to be modified. After a couple of hours of trying to determine where the lookup was located, a technician from Microsoft was able to point me to the correct form.

The form is 'vendaccountitemlookup'. This form is used in different areas of AX for use as the vendor field lookup form. So far, I have found it in 'Planned Orders' form within Master Planning and within Inventory Management under the 'References'. I will also place an example screenshot at the bottom of this post.

The problem our engineer had was that the lookup form has three tabs: 'All Vendors', 'According to Trade Agreements', and 'According to External Item Descriptions'. The 'All Vendors' tab only has the Vendor's Name field in it. If you click over to the 'According to Trade Agreements' or 'According to External Item Descriptions', you only see the vendor's account number. Now if you hold your cursor over the field long enough, you get the automated help text, but it disappears after a few seconds. I'm not sure why this wasn't existing functionality, but I am working on modifying this form to include the Vendor name joined to the proper vendor account number for the respective account number in each tab.

The AX Development Team was able to set this field's lookup simply by including the form name in the 'FormHelp' property of the Extended Data Type that represents the Vendor Account field, which in this case the EDT is 'ItemPrimaryVendId'.

I apparently missed this somewhere in the documentation I have read for AX as this being a possibility for assigning a lookup form to a field. To date, I have either coded my lookups dynamically using the systemlookup form within a lookup() method or I have performed it through an autolookup. As you can see this functionality will allow you to create powerful lookups that can even be multi-tabbed.

(VendAccountItemLookup Form)


Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation.

Sunday, December 10, 2006

Update

I've been absent from the Dynamics AX scene for five weeks now due to some other pressing issues. We have two additional developers now besides me so I've had to focus my efforts on hardware issues such as having our new EMC CX3-20 2TB SAN installed and getting our production systems physically installed and imaged at our new data center. We are getting pretty close to our go live date of February 1 and this week I'm finally transitioning back to the role of a developer / tester.

I have no substantial information to give out on AX this time, unfortunately. I have learned a lot of lessons as a result of having diverted my attention elsewhere for the majority of this past month.

AX 4.0 SP1 has been a distant blip on the radar screen and I was disappointed that it was delayed so long for release. Because of the amount of work that has yet to be completed, I have had to recommend to our project team and management to delay SP1's implementation until after go-live due to our time constraints.

The remainder of this month will be spent getting the AIF side of AX fully running and integrated with our WMS system.

Thursday, November 02, 2006

Custom Validation Modifications to AIF

Yesterday I was able to fully setup a custom validation within AIF. The validation was regarding ItemIds (Part Numbers) in AX. Out of the box, when the 'createListSalesOrder' action is executed on an inbound XML Sales Order, the entire process halts upon validation of an invalid ItemId (one that is not in the Item List (InventTable). I developed a workaround to check for the current ItemId's existence in the InventTable and if it's not present, replace the invalid ItemId with a valid catch-all ItemId, which will allow AIF to continue processing the Sales Order. So far this modification has been successful.

In general terms, you can make customizations to any of AIF's transactions simply by modifying the appropriate parm[field_name] method within the appropriate Ax[Table] class for the field that you want to add addition customizations on. In my example, I modified the parmItemId method within the AxSalesLine class. Here is the new parmItemId() method with my modification:

public str parmItemId(str _itemId = '')
{
DictField dictField;
ItemId tempItemId;
InventTable tempInventTable;
;

//My custom code to validate ItemId's existence in the Item Master and replace w/ 'InvalidItem' if not
tempItemId = _itemId;
SELECT FIRSTONLY ItemId FROM tempInventTable WHERE tempInventTable.ItemId == tempItemId;
if (tempInventTable.ItemId != _itemId)
{
_itemId = "**INVALIDITEM**";
salesLine.ItemId = _itemId;
salesLine.Name = tempItemId;
}

if (!prmisdefault(_itemId))
{
dictField = new DictField(tablenum(SalesLine),fieldnum(SalesLine,ItemId));
this.validateInboundItemIdString(_itemId,dictField);
if (this.valueMappingInbound())
{
item = _itemId;
}

this.setField(fieldnum(SalesLine, ItemId), _itemId);
}

if (this.valueMappingOutbound())
{
return conpeek(this.axSalesItemId(salesLine.CustAccount,salesLine.ItemId,salesLine.inventDim()),1);
}
else
{
return salesLine.ItemId;
}
}


Although this is my first shot at AIF modification, I would recommend placing your modification above the existing code. The out of the box code does other validations and checks like seeing whether or not AIF should place default data into a field.

Hope this helps!

Friday, October 27, 2006

Stepping through AIF Processing Code

I meant to cover this in my last entry, but Kamal beat me to posting how to debug the AIF Inbound Processing framework. Please check out his October 23rd blog at http://casperkamal.spaces.live.com/ for more details.

David

Followup to AIF Configuration Entry

I noticed an additional comment onto my AIF Configuration entry today and decided I would answer and inject some new findings that I have since last discussed. The comment asked how to add an additional field to an existing XML transaction such as the Purchase Order transaction which works off of the AxdPurchaseRequisition document.

First of all the documentation up on MSDN is getting a lot better. The documentation team has added many different articles on explanations of AIF, detailed explanations of the different transactions, and how the AxTable classes work compared to the Axd classes. Check out Dynamics MSDN at http://msdn.microsoft.com/mbs/

Generally, to add a field to any AIF transaction you must first determine the underlying tables to that transaction and add the appropriate fields. In the case of Purchase Orders, the main underlying table to it is the PurchTable/PurchLines or for Sales Orders is SalesTable/SalesLines. This is where you need to add the fields that you would like to appear in the AIF Transaction. Also, if you want these fields to be editable by your users, of course you need to add these to the front end GUIs to these tables. After you have made these additions, run the Axd Class Wizard to make these additional fields appear in the respective action's schema.

Axd Class Wizard Walkthrough
1.) Choose what Query is being used for the Axd Document Creation and click 'Next'.
(If the AIF transaction is one that came with the base AX installation, the query will be named Axd..., i.e. AxdPurchaseRequisition. You should also strive to name all of your custom AIF action queries with the 'Axd' prefix for standardization.)

2.) Leave the Class Name as-is and enter a label for the for the Axd class. Choose what actions can be performed for this AIF document transaction and click 'Next'. For a list of the actions' meanings, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/AxDeveloperDocs/html/89e37bf6-3dda-4485-b123-d091f46cc2ed.asp. You will notice that the 'Supported Actions' names on the Wizard correspond to the Axd Document Method column.

3.) On this final screen, if this is an existing Axd Document, you should see the 'Generate AxBC Classes' checkbox is grayed out. Check the 'Regenerate existing AxBC Classes' checkbox and click 'Generate'. If the Axd Document is new, check 'Generate AxBC Classes' and click 'Generate'.

4.) Open the Actions form in Basic -> Setup -> AIF -> Action. If the Axd Document you were working on already existed, you can simply highlight the action and click the 'Re-register' button. If the Axd Document was new, click the 'Scan and Register' button to reread all Axd Document classes, which will find your newly created class.

5.) Either way, after the scan and/or register process finishes, you should be able to highlight the appropriate action, click 'View Schema' and see the new field that has been added to the XML schema associated with the action.

Finally, just a quick overview of what the AxTable classes are compared to the Axd classes:

Axd classes extend the AxdBase class which contains the logic for developing the XML Schema and implementing the six Actions referenced above Create, CreateList, Send, SendList, findList, and findEntityKeyList. There is also logic for validating the XML documents for compliance to the XML Schema associated with the Action.

AxTable classes extend the AxInternalBase class and contain the logic for validating and writing data retrieved from the XML documents to their respective tables in AX. This class contains data validation logic. This logic is contain in each parmFieldName method within the respective AxTable class.

Currently, I am working to write my own custom AIF validation logic, particularly in the createListSalesOrder action and particularly with the AxSalesLine.parmItemId() method. Out of the box, AX kicks out any inbound XML SalesOrder that has a SalesLine that contains an ItemId that is not present within the InventTable. I am working to write additional validations to check for the existence of ItemId in the InventTable and if it does not exist, assigning a 'catch-all' ItemId to ItemId such as 'InvalidItem', and writing the original invalid item to the Name field. Ultimately the order will be halted and an alert will be sent to an Order Analyst who will try to determine what is invalid with the Item Id, but the order will still post in the SalesTable/SalesLine tables and won't be kicked out as with the current functionality. My current modifications have yielded failure on the processing part of the AIF but I'm confident I will have success within the next week. Once I determine how to add my validations without breaking the AIFInboundProcessing process, I will post my findings.

I see AIF as have the potential of being extremely powerful and extendable to incorporate custom business logic, but the documentation so far is nonexistent of how to do so in a standardized way in which you won't systematically blow up the existing processes (like I have in my tinkering).

I hope this helps. If you have any questions, I'll try to answer them as best as I can in subsequent entries.

Thursday, October 26, 2006

SP1 Enhancements Released to PartnerSource

I just reviewed the SP1 Enhancements that was posted up on PartnerSource. The enhancements won't impact us very much except for the well known fixes in SP1 like AOS Load Balancing issue being resolved. I won't repeat this list here as I don't know if the information is public domain at this point. If you have a partner who is willing to pass the document over to you, then by all means have at it. It's the 'Microsoft Dynamics AX Feature Updates (3.0 to 4.0) with the updated Appendix that lists all of the SP1 Enhancements.

Wednesday, October 25, 2006

Unexpected MODULUS functionality in AX 3.0/4.0

I came across this problem late yesterday afternoon and struggled with it again this morning until I received clarification from Microsoft on its intended functionality. I thought I would pass this along for those who may be struggling also.

I was working towards building functionality to test for the existence of line numbers in the Sales Line table where the line number had a .5 in it. For instance, if the line number was 2.5, I was attempting to perform 2.5 MOD 1 in order to get a result of .5. The only problem was that the system would not give me .5 but instead 0. It turns out that when the original AX developers wrote Axapta, they set the MOD function to only work against integers and not reals, hence the reason why I always got the whole number portion of the line number rather than the decimal part.

My workaround was writing a static method that converts the Line Number into a string, determines where the decimal place is in the string, performs a substring to pull out everything to the right of the decimal and convert it back to a real number and return it. This is essentially doing the same thing as MOD 1 would do to a whole number that has a fractional part.

Hope this bit of info helps!

Saturday, October 21, 2006

Creating Header/Detail-based Linkage On One Form

I have been struggling with a seemingly simple concept over the past couple days: How to setup a form that has two grids where one grid represents header-level data and the other grid represents detail-level data with the proper linkage. In all of the books, newsgroups, and blogs out there no one has yet to tackle documenting this seemingly simple task until now. I managed to get the form running tonight and I am posting this in case someone else may be struggling just like I have been. In my struggles I tried to mimic both the architecture and properties of both the SalesTable and SysEmailTable forms which have Header and Detail grids. Even after duplicating what these two forms use, my form still did not work properly. In all cases my detail form showed all records no matter which header record I placed focus on. Below is the steps that I have verified that successfully develops a header and detail grid. There may be other ways to accomplish this but this process definitely works.

1.) SETUP THE DATABASES: If you have not already, create your header records table and your detail records table.
a. Creation of your tables should include adding the appropriate Extended Data Types to your table for the fields you would like it to have.
b. Your Detail table should include the field that is in your Header table that you wish to use as the key between the two tables.
c. Add Indexes to both tables while including the key to your header table in the index along with including the same field that is in your Detail table as part of the index.
d. Add a relation to the Detail table to join the fields that appear in both the Header and Detail tables together.
e. If you wish to prevent database anomalies, add a DeleteAction to the Header table that performs a 'Cascade' DeleteAction on the Detail table.
2.) LINK DATABASES TO FORM: Drag the Header and Detail table into the Data Sources node of the Form you wish to use to display the two.
a. Set the Detail table's properties JoinSource property to the name of the Header table and verify the LinkType is set to Delayed.
b. If you do not want AX to automatically add a new record if no records exist, set InsertIfEmpty to 'No' in the Data Source properties of the Detail and/or Header data sources.
3.) DESIGN FORM FROM DATABASES: Add the appropriate container hierarchy to your form design and add the appropriate fields to each.
a. In my form, I created three groups within the form: Header, ControlSplit, and Detail.
b. The Header Group contains a Tab, within the Tab a TabPage, and within the TabPage a Grid control. The Grid control's datasource property is set to the Header table.
c. The Detail Group contains a grid control with the datasource property set to the Detail table.
d. Within the Header and Detail Group's grid, I dragged the appropriate fields/field groups into their respective grids.

Using these steps you should be able to correctly link Header Table data within a form to Detail Table data where only Detail Table data is displayed based upon the current Header Table data record.

I hope this helps those of you who maybe new to AX like myself and are struggling with a similar problem.

Wednesday, October 11, 2006

AIF Documentation Increasing...

I apologize for the delay since my last post. I'm working on several development projects, including Dynamics AX and just about all are unchartered territory, as well as administering our network and day-to-day IT operations.

AIF documentation is starting to be published up on MBS MSDN. I found some docs that really describe what AIF is all about in the Developer Documentation. These docs are only available up on MSDN and no equivalent .chm docs have been released to update the local help within AX.

You can find them under msdn.microsoft.com under:

-Servers and Enterprise Development
-Microsoft Business Solutions
-Microsoft Dynamics AX
-Developing for Microsoft Dynamics AX
-Microsoft Dynamics AX SDK
-Microsoft Dynamics AX and Other Applications
-Using Microsoft Dynamics AX and Other Applications
-Creating New Documents

This area has helped me understand really what the difference between the Axd classes and the Ax[Table] classes. To sum it up, Axd classes define the XML Schema for the document and Ax[Table] classes validates the data being exported or imported via XML.

My company's order receiving process is very non-standard due to restrictions mandated to us by our parent company. As a result some of the AIF/SalesOrder predefined pieces do not work for us out of the box. For example, we have to accept invalid Item Ids and return them via EDI to the customers who sent them. Out of the box AIF does not accept an order than has one or more invalid Item Ids. With this new documentation, I see now that I do not have to reengineer the AIF framework, but rather only add a few lines of code to handle invalid Item IDs within the AxSalesLine class.

As more and more documentation is released on AIF, the majority of which doesn't look likely to come until after the first of the year, more businesses will be able to customize the AIF document handling process to their specific needs.

I'd like to also say how great Microsoft Support has been during our learning AIF. They have had two LiveMeeting sessions with me so far and have answered all of the indepth technical questions regarding AIF that I have been able to think of. The guys attending the sessions have been AX AIF developers and project management so Microsoft is serious about issue resolution and taking the IT/Development AX Users straight to the people who know the product in and out.


Thursday, September 07, 2006

readPickingList AIF Action XML Export Problem Resolved!

In my previous entry detailing the process of setting up the AIF File System Adapter XML Export Capabilities, I mentioned the problems that I had been having with not being able to export the picking list through the readPickingList action. It turns out that if you have 'LogisiticsRegistration' configuration key enabled and you have the 'Set inventory transactions to picked' option unchecked, you will get the same errors that I received. Apparently this option doesn't check itself by default when you enable the LogisticsRegistration config key. The option is located at the following form: Accounts receivable -> Setup -> Parameters -> Update Tab.

Check the option, recreate a sales order, post the picking list and then you will be able to export it through the 'Inquries' button.

Note: This will not allow any Picking Lists posted previous to the option change to be exported.

Wednesday, August 30, 2006

Login Times in AX 4.0

I have been struggling with determining what is causing such sluggish login speeds whenever we log into AX 4.0, but have yet to determine the cause. I have had MBS support working with me on it, after much of my own troubleshooting combined with their troubleshooting suggestions and even as going as far to Profile the SQL server activity during the login period, a cause has not yet been determined.

Our development environment consists of two Dell servers, both running Dual Xeon 2.8s or higher, with 2GB of memory, both on GB ethernet, both Win2K3Ent. One server is a Development DC and SQL Server and the other server is an AOS/Terminal Services server. Either logging onto the AOS/TS and launching AX or logging onto the SQL/DC server and launching AX yields between 13 to 15 second login times. If I install the client directly onto my notebook (P-M 2.26 2GB RAM, 100Mbps eth XPPro) and login, same speed 13 to 15 seconds. I realized this morning after setting up dedicated 'Batch Server' from a Dell Optiplex P3 500 with 256MB RAM, also on 100Mbps eth (same switch as my notebook), and running Win2KPro, that the slowness couldn't be resource related because the Batch Server logs in within one to two seconds max.

This seems to me like it's an issue with AD and maybe the backwards authentication capability of a Win2KPro box onto a Win2K3Ent domain is different since WinXPPro and Win2K3Ent would logically have the same provisions for authenticating on a Win2K3 domain. I guess I'll have to wait and see if MS has any idea as to what the problem relates to with the addition of this new information. Is anyone else experiencing this long of login times? It's not 'crucial' for the login times to drop since a typical user will only login to AX once per day, but still it would be nice to shave at least half of that time off, but now that I know it can login between 1 to 2 seconds, that would be ideal to achieve.

Tuesday, August 29, 2006

Inside Dynamics AX by MSPress

I ordered Inside Dynamics AX yesterday from nerdbooks.com. They have by far the cheapest price on this book and other technical books that I purchase, plus the usually ship out within 30 minutes of order placement. These guys definitely know how to run an online book sales business. I was planning to buy three copies but they only had one. I'll get the other two when they are restocked.

Looking forward to getting the book in my hands on Thursday and I'll post a review on how '4.0'-based it is compared to the Axapta 3.0-based Dynamics AX: A guide to Microsoft Axapta.

We are ordering our new 9G Dell Servers for our permanent environment today or tomorrow. We are getting two Dual Core Dual Chip 1900 series 1Us and one Dual Core Dual Chip 2900 series 2U. Our production environment will be utilizing the Quad Core Dual Chips but those will not be out until late Q4 most likely.

Our go live date is set for January 2!

AIF Configuration and Additional Findings

There has been little documentation, if any, either on MSDN or CustomerSource regarding the implementation of AIF Services with the File System Adapter. I have worked over the past month in an effort to figure out how to implement and use both outbound and inbound services and I hope you find this information useful.

An overview of AIF
--------------------

AIF (Application Integration Framework) was implemented to allow for you to receive or send XML files based upon predefined or user-defined XML Schemas tied to actions that can be triggered in order to insert record(s) or extract record(s) to/from AX. Microsoft provides three different transport adapters that can be bound to multiple channels for processing the inbound/outbound flow of these documents. The three transport adapters are Web Services, Microsoft Messaging Queue, or File System.

Web Services provide exactly what you would expect: it offers an interface for you to provide to your vendors, partners, subsidiaries, etc for them to build an application that accesses data you have allowed them to access.

Microsoft Messaging Queue allows for you to implement XML document passing via applications which support the MSMQ technology. Entities that are allowed access to sending/receiving data from AX can submit XML documents and recieve XML documents through MSMQ and consume or post data from/to AX. MSMQ can be utilized in conjunction with a Message Brokering service such as BizTalk.

Finally, the topic I will be covering is the File System transport adapter, which is a method of passing XML documents except it does so via the Windows/Linux/Unix/other OS file system environments for those companies (like mine) who either have no message brokering software such as BizTalk 200x or have a message broker which does not utilize MSMQ.

I will explain the steps of how to implement AIF using the file system adapter but before we get started, a bit of planning must first take place. You must ask yourself that following questions:

1.) What data do you want to pass/receive?
2.) Who do you want to allow to receive/send data?
3.) Do you want to filter which data can be sent/received?
4.) Do you need to setup provisions for validating/translating that data?

Data that you pass to entities or receive from them are grouped into 'Actions'. Actions are grouped into sending groups of data or receiving groups of data. You can find a list of available actions in AX under Basic -> Setup -> Application Integration Framework -> Actions. If the list is blank, you must click the 'Scan and Register' button and the form will search through the AOT and find all applicable AIF Actions and provide them in the list.

As you well know, AX provides authentication directly from Windows Active Directory integration and as a result AIF utilizes that same authentication. An entity who consumes/provides data to you must be a member of your AD, be it a stripped account with access only to the file system folders needed to receive/submit XML documents. The first step to setting up AIF is implementing the necessary accounts to provide access to the respective folders that will act as a medium for XML document passing.

If you want to lock down for a particular entity what data they can send or receive, you may do so by putting constraints on the data. These constraints can limit record insertion/retrieval by Customer ID, Vendor ID, Warehouse ID, or a combination of the three.

If you need to translate data or validate data, you will need to setup a middleware message brokering system to have a maximum affect across all of your documents, however if you only need to validate a small amount of documents you may be able to achieve your goal through custom X++ coding tied to the AIF process. For translations of fields in an XML document, AX provides a basic field translator useful for translating data that maybe different for an external partner than for your internal company, i.e. external part numbers versus internal part numbers.

Now that you are thinking in terms of AIF, we can move forward with setting up the AIF processes. Each step will be universal to both inbound and outbound services unless I specify otherwise.

Configuring AIF
--------------------

1.) Create the appropriate folders to output/receive data from your XML document trading partners. You can come up with multiple strategies for deploying these folders based upon your security concerns and your need for segregating data among multiple consumers/providers. You could create a parent folder with subfolders containing the individual entities name and then subfolders below that are dedicated to inbound/outbound services. Under each inbound/outbound services, you could have subfolders named for each individual action.

You could even break down the hierarchy even further and have multiple subfolders under each action that are broken down by Customer/Vendor/Warehouse constraints so that only certain data can be outputted/received under those folders. You could also simplify the folder hierarchy to whatever you deem necessary for your AIF implementation, however the suggestion above works well for those who want to compartmentalize their data flows. Once you have created your folders, you must provide the ‘Network Service’ with full control to those folders.

2.) Next, you must setup the local endpoint for your organization. Local endpoints are created from your companies in AX. If you are only wanting to exchange documents with one of your companies within AX then you only need to create a local endpoint from that company. The local endpoint can be created by going into the Basic -> Setup -> Application Integration Framework -> Local Endpoints menu. Add a new record and select the company and create a name for that local endpoint.

3.) If you have not setup the File System Adapter, you will need to next enter the Basic -> Setup -> Application Integration Framework -> Transport adapters menu. If you do not have a record already existing in the list that has ‘AifFileSystemAdapter’ under the Adapter Class column, then create a new record and select ‘AifFileSystemAdapter’ from the Adapter Class column. Set the Adapter as ‘Active’.

4.) Next we will create the channels that you will be using. Channels link the File System Adapter to which direction documents will be flowing and from/to which folder the documents will go/arrive. Open the Basic -> Setup -> Application Integration Framework -> Channels menu. Create a new record and set the Channel ID and Channel Name. The Channel ID will be the referenced name when you select a channel linking the Endpoints to the channel. More on Endpoints to come soon... Set the adapter for the new record, which should be ‘File System Adapter’ and also set the direction.

The direction can be either ‘inbound’ or ‘outbound’ but it cannot be ‘both’ for the File System Adapter. After you have selected the direction, you can select the Address which will be the physical folder location on the machine where the XML documents will be sent from/received to.

5.) The next stop on our agenda will be the Actions menu again (if you went to it previously from our discussion in this article). Actions is located in Basic -> Setup -> Application Integration Framework -> Actions. If you did not do so previously (or it may be a good idea to do so again), click the ‘Scan and Register’ button on the Actions form. This will go through the entire AOT and register any Axd Document classes that are designed to work with the AIF module. For each Action that you would like to use, check the ‘Active’ field after all Actions have been registered.

6.) The final step in our setting up AIF within AX is to create Endpoints. Endpoints are the entities (or Trading Partners) with which you will exchange documents. You can reach the Endpoints menu by going to Basic -> Setup -> Application Integration Framework -> Endpoints. Create a new record and enter an Endpoint ID. This should be descriptive as to who the entity/Trading Partneris since it will be what you select for some of the forms that require you to manually select an endpoint. Next, you will create a name for the endpoint and also choose the local endpoint that will be communicating with the entity/trading partner. If you have multiple companies in AX and each company will be exchanging documents with this particular Endpoint, then you will need to have one Local Endpoint for each company and AX, plus multiple Endpoints setup for the same entity/Trading Partner to join to each individual Local Endpoint.

The Endpoint to Local Endpoint relation is one-to-one. The next step to configuring the Endpoint is to go to the Constraints tab and either select ‘No Constraints’ or add as many Constraint records as you wish. As I alluded to earlier, constraints may be created for customers, vendors, or warehouses. So far the only Action that requires constraints is the ‘readPickingList’ action. (I will go into more detail about this action earlier as I share with you the current experience I am having with setting up this action. ) The next step is to configure the ‘Users’ tab. In the Users tab, you can set up one or multiple users (AD logins) or one or more groups (AX security groups). This is the security that is built into AX so that not just anyone can send/receive XML documents into/out of your system. You can also setup ‘Trusted Intermediaries’ which would be like another AD with which you would setup a ‘trust’ relationship.

Finally the last major step in setting up the Endpoints is setting up the Action Policies associated with the Endpoints. This piece ties the Endpoint to the Actions that we viewed earlier. Click the ‘Action Policies’ button on the Endpoints form. Here we will create a new record and select an Action to tie to the Endpoint. (Note: only actions that you have activated will appear in the list. If you want to see all actions appear, then you will need to go back to the Actions menu and Activate all Actions.) After selecting an Action, set the status to ‘Enabled’ and set the logging mode to your preference. I use the ‘Log All’ mode in order to get all information about problems with AIF transactions.

Once you have filled out the record, click the ‘Save’ button on the toolbar to save the record and you will see the ‘Data Policies’ button highlight on the Action Policies form. Click the ‘Data Policies’ button and you will see all of the XPath elements that will be included in the XML document for this particular action. In order to allow all elements to be displayed, click the ‘Set’ button and select ‘Enable All’. The final step will be to exit out of the Data Policies Form, and then out of the Action Policies form, and when you are back in the Endpoints form, select the ‘Active’ checkbox on the General tab in order to activate the Endpoint.

7.) If you are receiving XML documents inbound into AIF, there are a couple of things that must happen to the documents before AIF will accept them. First, at least one of the person(s) or members of group(s) that are listed under the User tab in the Endpoint menu must be the owner of the inbound XML document. You can check this by right-clicking the document, selecting Properties, selecting the Security tab, clicking the Advanced button, and choosing the Owner tab. Below you will see a list of users who are owners of the document. Whichever one that is in the list that also is listed in the Users tab of the Endpoints, you must highlight this user and select Apply. You should see that the owner of the document changes to that user.

AIF will not process a document if the owner of the document is not affiliated with the ‘Users’ tab in Endpoints. Within the XML document being sent inbound, there is an area in the XML header that allows you to set the MessageID, SourceEndpointUser, SourceEndpoint, and DestinationEndpoint. The MessageID must be a unique GUID, the SourceEndpointUser must be set to same user that is the owner of the inbound XML document in the format of ‘DOMAIN\USERNAME’, the SourceEndpoint must be the Endpoint ID from the Endpoint menu who sent you the XML document, and the DestinationEndpoint must be set to the Local Endpoint ID which will be the company in AX that should be receiving the XML file that you defined earlier in the article in Local Endpoints.

8.) Now that you have setup AIF, you must setup the batch processes to execute the AIF processes. I will not go through the batch process setup as there is plenty of resources out on MSDN that defines this, plus batches are not new to AX 4.0. I will let you know that in your Batch Journal Types, for AIF File System adapter processes to be batched, you must select the ‘AifInboundProcessingService’ and the ‘AifOutboundProcessingService’ for the inbound and outbound AIF processes to be batched. You can also view errors and the Queue Manager that has the documents waiting to be processed in the Basic -> Periodic -> Application Integration Framework menu.

Additional Thoughts on AIF
---------------------------------

A couple of additional words regarding AIF. I have so far tested the inbound AIF and not had any problems posting XML documents to AX as long as all steps are followed correctly. The only problems I ran into were related to not correctly setting the owner of the document and the SourceEndpointUser. I have however ran into a problem utilizing the outbound ‘readPickingList’ action. For some reason I cannot execute that action and even after debugging the code I cannot tell what the reason is.

It specifically looks for a constraint to be set for the warehouse, which I have but because the InventDim record is not being set into the code that exports the XML document, it will not execute properly. The problem is that there is no code for setting the InventDim record, nor does the function pass in a pointer to the InventDim record associated with the picking list. I currently am working with Microsoft to come up with a solution and will post back on here what their/my findings are once there is resolution.

Also, I have yet to figure out where the ‘Send Electronically’ buttons are located for the ‘readListInventoryOnHand’, ‘readListInventoryTransactions’, and ‘readListSalesOrder’. If I am able to find where these buttons are, I will post an update to the blog detailing their location.

As a quick reference for you also, I am including the list of all of the outbound actions and the location of the button that triggers them:

Action ID\Description: findListChartofAccounts - sends Chart of Accounts
Button Location: GL\Chart of Accounts\Send Electronically

Action ID\Description: findListExchangeRates - sends Exchange Rates
Button Location: GL\Setup\Exchange Rates\Send Electronically

Action ID\Description: readASN (Packing List) - sends Packing Slip
Button Location: AR\Sales Order\Inquiries\Packing Slip\Send Electronically

Action ID\Description: readSalesInvoice - sends Sales Invoice
Button Location: AR\Sales Order\Inquiries\Invoice\Send Electronically

Action ID\Description: readListPriceList - sends Price List
Button Location: AR\Customers\Trade Agreement\Send Electronically

Action ID\Description: findListDimensions - sends GL Dimensions List
Button Location: GL\Dimensions\Send Electronically

Action ID\Description: readPickingList - sends Picking List
Button Location: AR\Sales Order\Inquiries\Picking List\Send Electronically

Action ID\Description: readListPurchaseRequisition - sends PO
Button Location: AP\PO\Inquiries\PO\Send Electronically

If you happen to find something that I have missed or would like to comment further on any of my findings above, please do so.

Thursday, June 29, 2006

Preliminary Installation and Toying

Today and Yesterday were filled with playing around with my new software toy....Dynamics AX 4.0. We received our initial CDs and License keys. I installed the Demonstration on my laptop inside of a Virtual PC and I installed a preliminary development server on our new PE 2850. I have the Development Environment implementation broken up into three distinct servers: A VM SQL Server, A VM AOS/File Server, and an IIS Server. I installed the client on the Domain Controller hosting the three VMs and I was shocked how easy it's installation was. According to what I've read it's apparently exponentially easier to install than it's predecessor, Axapta 3.0.

Surprisingly, there's quite a bit of documentation in the What's New guides and Implementations Guide. Judging by how antiquated and pieced together the Axapta 3.0 docs were, this was not expected. Tomorrow will be spent rummaging through the docs and get a basic AX install configured. Our Partner will be on site the week after July 4th and will step me through their recommended installation process and setting up a base installation. At least by that time comes I will have at minimum installed it twice, maybe three times, and will have an idea about questions to ask when he/she guides me through the correct way.

From what I see so far this is an enormous package. I'm sure it's nothing quite like SAP, but still nonetheless it's huge. One piece alone, the AIF, is almost a complete mammoth application just in itself. I'm going to be concentrating on getting some sample documents templates out so that I can test some scenarios of EDI parsed and translated through our Message Brokering software to be outputted and inserted into AX.

I will continue to update my progress on this site and look forward to comments regarding my experiences. I'm looking forward to this journey as it will be a long one lasting roughly 16 to 24 months before we are fully live on AX.

Hope you enjoy the ride,

David

Tuesday, June 27, 2006

This is a test