We have a folder custom type 'CtFold'. One of its attributes is 'Attr1'. We want to make this attribute mandatory only inside one cabinet 'Operations'. As we cant make the attribute mandatory, we thought of validation inside in TBO customization, overriding doSave() method as given below.
public class CtFold extends DfFolder implements IDfBusinessObject { protected synchronized void doSave(boolean arg0, String arg1, Object arg2[]) throws DfException { super.doSave(arg0, arg1, arg2); [remaining code] . . . // objCab holds the cabinet object under which the current folder gets created. // strAttr1 has value of Attr1 in the form of String. if (objCab.getObjectName().equals("Operations")) { if (null == strAttr1 || "".equals(strAttr1)) { throw new DfException("Attributes Attr1 should not be empty. ");} } } }}This works fine and webtop throws the custom message when value is not entered for 'Attr1' when a folder of type 'CtFold' is created anywhere inside 'Operations' cabinet.
But when we import a folder(with subfolders) from local hard disk, we get the exception only after importing all the objects. i.e, at the end of the operation, webtop throws the message. But the user is not able to enter the missing information then.
How can we make modifications in the code, so that it works fine even during importing folders.