cancel
Showing results for 
Search instead for 
Did you mean: 

Validation Messages

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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