preEdit business rule

preEdit business rule

rwgreenwoodrwgreenwood Posts: 43Questions: 13Answers: 0

I need to validate a record based on a business rule. I am looking at the preEdit event. From there, I need to do an additional query to the database to verify a business rule limit based on other entries. My first question is am heading down the right path? Is this possible to do from preEdit or is there a better place? I am also looking for documentation that would show how to handle an error returned from such a validation. Thanks.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi,

    The global validation might actually be the best option for what you describe. You could use preEdit since it is cancelable, but its not so easy to return validation error messages to the client-side. The validation methods make that much easier.

    Regards,
    Allan

  • rwgreenwoodrwgreenwood Posts: 43Questions: 13Answers: 0

    Thanks for the reply. I see what you mean about returning messages from the preEdit - I haven't figured that out yet. Do you have any examples? I'll look at global validation as well.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I don't have any example of that as such as it isn't really designed for that. The validation errors should be returned by the validation functions.

    Allan

  • rwgreenwoodrwgreenwood Posts: 43Questions: 13Answers: 0

    Alan, I got a query and return in the global validation to work for what I need. Thanks for your help.

This discussion has been closed.