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, ...
Unanswered

error Message is displayed in Action center in some cases

(0) ShareShare
ReportReport
Posted on by 65

Good morning,

I'm a x++ developer and I'm facing an issue and it seems taking me long than I did expect so I would really appreciate your help.

In fact, I have a condition that must be satisfied when creating a purchLine. so I'm handling it in validateWrite method of the PurchLine. 

in case the condition is not true I'm throwing an error :

throw Error("some text");

In this case, all works good and I got the message displayed in the message bar. 

However, when I try to add a product (as figure shows) I have the message displayed in the Action center whereas it is needed to act the same way, and be displayed in the message bar instead. 

pastedimage1660034846689v1.png
Greatful for your help. 

I have the same question (0)
  • Komi Siabi Profile Picture
    13,109 Most Valuable Professional on at

    Hello NissenB,


    This article best explains the behavior of your message why it shows on the message bar or the action center.

    docs.microsoft.com/.../messaging-api-center-bar-details

  • André Arnaud de Calavon Profile Picture
    301,130 Super User 2025 Season 2 on at

    Hi NissenB,

    The Add products functionality is first collecting information in a temporary table and then probably inserting the records on the PO line with a doInsert() command which is skipping the validateWrite() method. I can recall something similar from a long time ago. You can check this in the development environment and you would need to write an extension for this feature as well

  • NissenB Profile Picture
    65 on at

    thank you for your help. I checked and debugged methods that are executed. In fact, validateWrite() is being called but somehow the "throw error("")" is sent to the action center. I've seen some "setPrefix()" method in standard code (RetailCreateLinesFromProductsToAdd, createSalesLine()), so I guess all the messages encountered before this method is converted as a child node of it.

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
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans