Sunday 21 July 2013

How to Display multiple errors in OAF

Sometimes you have to show all the error messages at one shot,instead of showing the error messages one by one. In that case, we have to use bundled exception to show multiple error message. Below are the steps:

1. Add the import statements:
import com.sun.java.util.collections.ArrayList;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.common.MessageToken;
2. Declare an array list.
ArrayList errorMsg= new ArrayList();
3. Raise OAException.
for (int i=0; i< hMember.size(); i++)
{
                         MessageToken[] token = {new MessageToken("USER", getOADBTransaction().getUserName()),new MessageToken("NUM",hMember.getChildNumber())};
                        errorMsg.add(new OAException((String)(getOADBTransaction().getMessage("XXCH","XXCH_NO_ACCESS",token))));
}
OAException.raiseBundledOAException(errorMsg);
                        

No comments:

Post a Comment