Skip to main content
Solved

Display message in event handler

  • Feb 8, 2021 10:43 AM UTC
  • 3 replies
  • 503 views
  • Translate All

Forum|alt.badge.img

Dear community,

 

I would like to show a message to the user from an event handler. In my case it is Events.RowInserted.

I tried throw new PXException and PXSetPropertyException. Both are logged to the Trace but nothing pops up in the browser.

 

Any help is welcome.

 

Best answer by Naveen Boga

Hi @mhaps,

Have you tried with FieldUpdated event instead of RowInserting?

 

Also, can you please us know, on what scenario/condition you want to display error message?

View original

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Answer
  • Feb 8, 2021 12:08 PM UTC

Hi @mhaps,

Have you tried with FieldUpdated event instead of RowInserting?

 

Also, can you please us know, on what scenario/condition you want to display error message?

Translate

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Feb 8, 2021 1:00 PM UTC

That is a good idea @Naveen B. PXSetPropertyException with PXErrorLevel.RowError fired in FieldUpdated marks the Row as Invalid.

That solves my problem.

 

The aim is to limit the entries in the grid.

First try was setting AllowInsert. But that is not reliable, it seems to be set back after event handling.

 

Thanks!

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Feb 8, 2021 1:07 PM UTC

@mhaps

First try was setting AllowInsert. But that is not reliable, it seems to be set back after event handling.

I agree with you :thumsup

 

Great :) Thanks a lot for the verification and update.

 

Translate