public void deleteMemoByIdIdx(long TenantId, long MemoId) {
   CFCrmMemoPKey pkey = ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newPKey();
   pkey.setRequiredTenantId(TenantId);
   pkey.setRequiredMemoId(MemoId);
   ICFCrmMemoObj obj = readMemo(pkey);
   if (obj != null) {
     ICFCrmMemoEditObj editObj = (ICFCrmMemoEditObj) obj.getEdit();
     boolean editStarted;
     if (editObj == null) {
       editObj = (ICFCrmMemoEditObj) obj.beginEdit();
       if (editObj != null) {
         editStarted = true;
       } else {
         editStarted = false;
       }
     } else {
       editStarted = false;
     }
     if (editObj != null) {
       editObj.delete();
       if (editStarted) {
         editObj.endEdit();
       }
     }
     obj.forget(true);
   }
 }
 public void minimizeMemory() {
   allMemo = null;
   indexByTenantIdx = null;
   indexByMemoContactIdx = null;
   indexByUDescrIdx = null;
   List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
   ICFCrmMemoObj cur = null;
   Iterator<ICFCrmMemoObj> iter = members.values().iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     if (cur.getEdit() == null) {
       toForget.add(cur);
     }
   }
   iter = toForget.iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     cur.forget();
   }
 }