Skip to Content
avatar image
Former Member

Validation Messages

Hi Experts,

i've a problem with custom validation

while pre phase change time i am checking the some fields not null if fields or null i want show the error message to user at the movement i am showing error message one by one but i want all my required field error message at time.

Thanks

Vasantha

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 09, 2010 at 11:31 AM

    Hi Vasantha -

    The IAPI scripting allows you to chain exceptions and throw the full list after all validations are complete. This sample code shows how that is done:

    // Create Application Exception to hold exceptions
    ApplicationException ae = new ApplicationException(session);
    
    ...
    
    // Perform validation here...if there is an error,
    // chain a new exception to the list
    ae.chainAtEnd(doc.createApplicationException("field id", "resource id"));
    
    // Perform additional validations here...
    
    // If we get to the end and have some exceptions, throw them now
    if (ae.getChain() != null)
    {
        throw ae;
    }
    

    The concept is to create an initial exception, add (chain) all exceptions to that initial exception, and throw the initial exception at the end once all validations are complete.

    Hope this helps.

    Rob

    Add comment
    10|10000 characters needed characters exceeded