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

Notifications

Announcements

No record found.

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
    237,965 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
    237,965 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans