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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

AIF x Swagger

(0) ShareShare
ReportReport
Posted on by 185

I'm starting to work with AIF and is working fine, but I have some doubts to treat the errors. The integration is working with Swagger (C#) and to create, delete, find is working well. But, when I try to find or delete an order that is not exists, show the error "ExceptionMessage": "Object reference not set to an instance of an object.". Anyone knows how can I treat it? I want that return a message like "Order does not exist". Need I treat it in AIF or C#?

Thanks!

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,166 Moderator on at

    AIF returns what it returns, so you should handle it in C#.

    If you try to delete an order and get this error message, then you can return your own error message to the user of your code.

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

    Do you get the message from a NullReferenceException in your client code or in a FaultExeption returned by the remote service? In either case, you'll need to find where it's coming from, but you'll be looking into a different application in each case.

    By the way, Swagger toolset contains quite a few things; it sounds like you're using a C# code generator. If it's relevant to the problem, please give us more details about what you did.

  • Rafael Araujo Profile Picture
    185 on at

    Hi Martin,

    I solved the problem using the array list. When the list is empty or null, they return the value that I want.

    Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 681

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 446 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 202 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans