Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Cannot figure out how to add a C# method to my X++ code.

Posted on by 115

So I need to add a method to my code that validates a customer's address through a third party address validation API.  AFAIK, the only way to do this is to do the service call in a C# method, and use that C# method in your X++ code.  I found an example of the way someone else had done it for our company, but I don't understand exactly how it works, and I've hit the wall when trying to do it myself.  Here's the example:

addval1.PNG

addval2.PNG

So after seeing this example, I tried to do the same thing:

addval3.PNG

addval4.PNG

I'm thinking that the problem may be that I have not deployed my classLibrary1.  However, when I try to find the deployment properties for the project, nothing shows up:

addval5.PNG

Here's some pics of the actual code, if that is needed:

The one that works:

addval6.PNG

Mine (doesn't work):

addval7.PNG

*This post is locked for comments

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,198 Most Valuable Professional on at
    RE: Cannot figure out how to add a C# method to my X++ code.

    You're almost there. :-)

    Deployment options are not in the form where they're looking for them; they can be found in the Properties window:

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans