예제 #1
0
  /**
   * Saves entity field
   *
   * @return original TargetList record
   * @throws Exception
   */
  private TargetList saveEntity() throws Exception {
    TargetList originalTargetList = null;
    if (targetList.getId() == null) {
      UserUtil.permissionCheck("create_targetList");
    } else {
      UserUtil.permissionCheck("update_targetList");
      originalTargetList = baseService.getEntityById(TargetList.class, targetList.getId());
      targetList.setTargets(originalTargetList.getTargets());
      targetList.setContacts(originalTargetList.getContacts());
      targetList.setLeads(originalTargetList.getLeads());
      targetList.setUsers(originalTargetList.getUsers());
      targetList.setAccounts(originalTargetList.getAccounts());
    }

    User assignedTo = null;
    if (this.getAssignedToID() != null) {
      assignedTo = userService.getEntityById(User.class, this.getAssignedToID());
    }
    targetList.setAssigned_to(assignedTo);

    User owner = null;
    if (this.getOwnerID() != null) {
      owner = userService.getEntityById(User.class, this.getOwnerID());
    }
    targetList.setOwner(owner);

    super.updateBaseInfo(targetList);
    return originalTargetList;
  }
예제 #2
0
 public String relateTargetListContact() throws Exception {
   targetList = baseService.getEntityById(TargetList.class, id);
   Set<Contact> contacts = targetList.getContacts();
   Iterator<Contact> contactIterator = contacts.iterator();
   long totalRecords = contacts.size();
   ListContactAction.getListJson(contactIterator, totalRecords, null, false);
   return null;
 }