Best way to send a message from PO.beforeDelete failure

For those who got the Open Source fever, sharing only makes you hot!

Moderator: neilg

Best way to send a message from PO.beforeDelete failure

Postby neilg » Sun Jun 26, 2005 3:17 pm

You've got a class thar extends PO . You want to check some logic that prevents the deletion of a record. You override the method PO.before(delete):boolean in your PO class.

Now you need to send some diagnostic info back to the client. You can't just have a message 'failed to delete'.

Code: Select all
...check my precondition..
if fails
        {
            throw new MyRuntimeException("Sorry you cant delete this record. This is the reason why.");
        }
       
        return true;


Disclaimer: not sure if this is the best practice. Will keep this thread updated as I learn.

Tested on 2.5.1g
neilg
Regular
 
Posts: 141
Joined: Thu Jun 16, 2005 1:58 pm

Return to Contributor's Corner

Who is online

Users browsing this forum: No registered users and 1 guest

cron