Dynamics AX
  RSS Feed  LinkedIn  Twitter
Want to turn you're data into a true asset? Ready to break free from the report factory?
Ready to gain true insights that are action focused for truly data informed decisions?
Want to do all of this across mutliple companies, instances of Dynamics and your other investments?
Hillstar Business Intelligence is the answer then! (www.HillstarBI.com)

Hillstar Business Intelligence for Microsoft Dynamics AX and NAV on Mobile, Desktop, Tablet


Let us prove to you how we can take the complexity out of the schema and truly enable users to answer the needed questions to run your business! Visit Hillstar Business Solutions at: www.HillstarBI.com

Friday, July 28, 2006

using the SysDictClass to create and use objects

One of the more intersting approaches to a solution I came up with was to use the SysDictClass to create objects and run the objects methods. Basically I was creating an import tool for EDI that needed to be easily expandable and associated with other customers / vendors. So I came up with a import formating concept similar to the Check formating or VendPaym class structure.

Basically you create a Process [Action Class] and a Data [Formating] class. During the 'configuration' a user would take and select say a vendor they wanted to import Items from to re-sale. Well for that Vendor they would use a new form to select what type of Process class and action this was. So for the new item imports they would select Import Items, and then select the Process class to be used. This would then be stored in a table, and when new data came in from that vendor a Batch would kick off an overall processing class, that would take the passed in VendorId and use it to see if that Vendor has a process class associated with it. If so then it would take the string value of the class name and execute the run method of that class. From there what ever was in the run would happen, and the importing would work. below is an example of the code used to create a object from the SysDictClass and then call it's run method.

SysDictClass obj;
;

obj = new sysDictClass(ClassName2id("Process_V0001"));
obj.callObject("run",obj.makeObject());

Now with this structure in place the client could easily create a new Process class that would extend from a given base class, that all would contain a run. This run method would house the starting point for any business logic that needed to be ran, and then they would assocaite this class with the Vendor through the new table.

Next time an event fired for the given VendorId, if an entry existed, it would then return that string value of the class and the logic would be executed. This in turn makes it a very flexible / scalable approach, so that only a new process class needs to exists, and a Union between that class and the VendorId, along with a description in the table of what this does.

From here I will most likely create a Wizard that will walk through and based on answers actually create the new Process class for them. (or at least as much as it can create.) All in the name of making this flexible and easy to add more partner processes.

Find a job at: www.DynamicsAXJobs.com

0 Comments:

Post a Comment

<< Home


Copyright 2005-2011, J. Brandon George - All rights Reserved