Rick
Rick

Reputation: 1311

Display a message

What' the quickest way to display a message similar to MsgBox in C# ? I've tried this:

Base.Document.View.Ask("Hello World", MessageButtons.OK);

It publishes but I'm getting an error when it executes.

Upvotes: 1

Views: 2877

Answers (1)

Hugues Beauséjour
Hugues Beauséjour

Reputation: 8278

For that use case, throwing an exception will be enough:

throw new PXException("Hello World");

It uses the browser themed message box: enter image description here

For debugging I prefer using traces:

PXTrace.WriteInformation("Hello World");

Message will appear in the trace window: enter image description here

You can open the trace window in the help menu from most Acumatica screens: enter image description here

Upvotes: 5

Related Questions