on 09-09-2010 3:49 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.