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

How to send infolog messages / errors from C# in F&O?

(0) ShareShare
ReportReport
Posted on by 20

Hello,

I’m calling an API from C#, and I need to display the authentication error, or any other error from the service.

I want to send the error to the client like this

Error(“Authentication error”);

But from C#. Just want something like an info message but from C# to the client in Dynamics.

How can I achieve this? Console.WriteLine wasn’t useful for me.

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

    Please tell us more about your architecture. You mentioned that you have something written in C#, but it's not how it's related to F&O.

    If you have a C# library that you use directly in F&O through .NET Interop, unhandled exceptions propagates to F&O and are displayed to users, or they can be handled in X++.

  • ntorres Profile Picture
    20 on at

    Hi Martin, thanks for replying.

    I created a C# project and added the reference in my F&O project.

    Now I am throwing an exception in C# like this: 

    throw new Exception(“Error in request.”);

    .

    And I want to show that specific message in F&O, I’m doing it like this:

    System.Exception ex;

    /////rest of the code

    catch(ex)
    {

          throw error(ex.Message);

    }


    But in the infolog shows “One or more errors occurred” instead of my custom message.

    How can I display the custom exception from C# in F&O?

    Thanks.

  • Martin Dráb Profile Picture
    238,745 Most Valuable Professional on at

    Can you show us a screenshot, please?

    You forgot to mention whether the exception is caught or not. Use the debugger to find the information, if you haven't tried to debug your code yet.

    How do you execute your code? Through SysOperation framework, for example?

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 402

#3
Diego Mancassola Profile Picture

Diego Mancassola 261

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans