Expand my Community achievements bar.

Custom Error Message (How to?)

Avatar

Level 2

Hello,

I have a removeInstance tied to a button in the click event.  I know this will generate a default Adobe error if the minimum number of rows have been reached.

I would like to replace the default Adobe error of "index out of bounds" with a more user friendly error message.

I tried this after the removeInstance, but default error still popped-up:

xfa.host.messageBox("Delete error encountered.  Maximum number of rows deleted.", "Warning",1,0)

Can someone offer assistance?

Thanks

2 Replies

Avatar

Level 10

You cannot change the error massage but you can suppress it completely.

This script will check if the row "Row" currently occurs mor than 1 time, which is the minimum.

If so, the script to remove an instance is executed, otherwise your message is shown.

Avatar

Level 2

Hi,

You can write a webservice to handle the array index bound of exception and call the same when the _Row.count<=1

Thanks

Arjun