Thursday 5 April 2012

How to create field validation class which extends MAXTableDomain

1. Write a custom field validation class and extend MAXTableDomain. (import psdi.mbo.MAXTableDomain)
2. Create a constructor and set a relationship with Object (table name).
3. Set a list criteria in the constructor itself (where clause for the above object).
4. If you would like to filter with more where clauses then write a getList() method.
5. Associate this field validation class to attribute in DB Configuration. And make sure that domain is not associated to this attribute.
Sample Class:
public class CustomFeildClass extend MAXTableDomain
{

public CustomFeildClass (MboValue mbv) throws RemoteException
 {
super(mbv);

String thisAttrName = getMboValue().getAttributeName();
setRelationship("FAILURELIST","failurecode=:"+ thisAttrName)
// Note: Here FAILURELIST is a Object. Most of the developers will confuse that it is a relationship name.
 
setListCriteria("parent is null");
//Note: this sets a where condition for the above object.
setErrorMessage("asset","failurecode");
 
 }
public MboSetRemote getList() throws MXException, RemoteException
 {
String additionalWhere ="orgid=:orgid";
setListCriteria(additionalWhere);
//Note: this sets additional where conditional to display when user clicks on lookup.
}
}
 

No comments:

Maximo SOAPUI error javax.xml.ws.WebServiceException

SOAPUI error while sending payload to below url (in cluster environment) http://localhost:9080/meaweb/services/MXASSET Error : <f...