This topic will begin the process and explanations on how to get Ax 3.0 talking to the outside world. If you want to build cool .NET Web Services, .NET Windows Services, or .NET Forms applications, it starts here.
Before we begin, I will start by saying that none of what I have done, or will do, is meant to imply that Microsoft endorses these solutions, only that they are done using their tool sets. First, and most importantly, no access or integration is done with Axapta by bypassing the Business Connector. The Business Connector is our entry point into Axapta and it enforces the security, rules, constraints, and concurrency models of the core application.
Phew, now that the disclaimer is out of the way we can get started.
When I said I use the business connector as the root of my extension, I didn't mean that this was going to be another example of using it like an old ADO connection or even ADO.Net. There are plenty of sites, including MSDN, that will show you those lame examples. In fact, there is little in common between the ADO Recordset and the Business Connector's IAxaptaRecord objects, other then they are both COM components, therefore unreliable at best. The Business Connector, otherwise known as the COM Connector, needs a lot of help to compete with even the flaky ADO components.
I'm sure you have all seen the example of creating the Axapta COM object in an ASP.NET page. It's trash really and nothing you can trust a billion dollar business solution to, BUT seeing it 2 years ago showed me what I was going to build off of it.
What if I told you the below examples were not only possible, but are the most basic examples of what is possible.
Example 1
private string RetrieveEmployeeNameByID(string emplID)
{
EmplTable emplTable = new EmplTable();
emplTable.RetrieveByEmplID(emplID);
return emplTable.Name;
}
Example 2
private void UpdateEmployeeNameByID(string emplID, string name)
{
EmplTable emplTable = new EmplTable();
emplTable.RetrieveByEmplID(emplID);
emplTable.Name = name;
emplTable.Save();
}
... are you with me now? Would something that simple make your life easier? Does it look like a lot of work under the hood?
Well, if your still reading, chances are Yes to all of the above. I can help you on number 3.
Basically, it's all the inheritance model, in this order.
1) Business Connector
2) Data Layer classes to consume the Business Connector
3) Object Class model to consume the Data Layer
4) Presentation to marshal the Object Model.
That's all there is to it, and also the 4 parts to this series. Remember, this is the most important part of your extension. Number 4 is up to you and it's limitless, but you have to do 1, 2, and 3 right to make it sturdy.
That's the introduction folks. This series implies that you have a working Business Connector installed, a good understanding of the .NET Framework and Visual Studio, and strong C# skills. For this series I will be coding in it, but may be able to help with VB.NET too, I just won't like it.
Thanks all, and stay tuned for Part 1 - The Business Connector.
H
Saturday, March 15, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment