web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Using AX 7 container in C#

(0) ShareShare
ReportReport
Posted on by

In AX 2012, we had the functionality to use Axapta containers in c# by means of the business connector. Now that the business connector has been depreciated in AX Online, is there any other way we can make use of containers in .net or c# code?

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,831 Most Valuable Professional on at

    What are you trying to achieve?

    By the way, please separate tags by comma; you've attached a single long tag "container axapta online ax7 business connector. I'll fix it for you this time.

  • Community Member Profile Picture
    on at

    Basically, we have ax classes that take containers as parameters and return containers as a result. These classes are used to integrate ax 2012 with a web portal.

    Just wondering if there is another way (other than using business connector) to use containers in C# from AX Online. This would reduce a lot of re-work on the existing classes (around 200).

    thanks

  • Martin Dráb Profile Picture
    239,831 Most Valuable Professional on at

    All right, so now the question stays: Why do you have methods accepting and returning containers to and from a web portal? What are you trying to achieve by that? Do you exchange binary data, such as PDF files, or just regular values. If it's the latter case, what advantage do you get from using containers instead of classes? I would argue it's a wrong design, leading to error-prone code (because the lack of compile-time type control and such things).

  • Community Member Profile Picture
    on at

    Thanks for the reply Martin, I do agree with you that it is not the best design. But these classes have been developed since AX 2009, upgraded to 2012, and now will be upgraded to AX7. Additionally, these classes where developed by another software vendor, and we are looking into reducing the rework for the upgrade process.

    To give you an example of how the classes work, lets take a sample class - getCustomerInfo.

    Like all the other classes, this class takes a few parameters, which are built from the portal and converted into an Axapta container. The AX class then executes certain functionality inside AX, and will return a result (either the customer, or a list of error), all of which within a container. They are then read inside the portal and displayed to the user.

    I hope that I made the situation a little clearer.

  • Verified answer
    Martin Dráb Profile Picture
    239,831 Most Valuable Professional on at

    You deal with technical debt - when somebody did something wrong in past and it's causing more and more problems on the way (interest) unless somebody finally pays the debt (and rework the bad solution to something sensible).

    When moving from BC, you have to change your implementation anyway and trying to keep this ugly anti-object-oriented design just makes no sense. You would spend a lot of time and energy trying to re-implement a thing that was wrong even in AX 2009 and which would increase your maintenance costs. There is simply no good reason to do that.

    Creating a contract class and using it instead of the container is work for a few minutes.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 10

#2
Harisgillani Profile Picture

Harisgillani 4

#2
dserp Profile Picture

dserp 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans