/**
  * Checks to see if there has been an override lookup declared for the maintenance field. If so,
  * the override will be used for the quickfinder and lookup utils will not be called. If no
  * override was given, LookupUtils.setFieldQuickfinder will be called to set the system generated
  * quickfinder based on the attributes relationship to the parent business object.
  *
  * @return Field with quickfinder set if one was found
  */
 public static final Field setFieldQuickfinder(
     BusinessObject businessObject,
     String attributeName,
     MaintainableFieldDefinition maintainableFieldDefinition,
     Field field,
     List<String> displayedFieldNames,
     SelectiveReferenceRefresher srr) {
   if (maintainableFieldDefinition.getOverrideLookupClass() != null
       && StringUtils.isNotBlank(maintainableFieldDefinition.getOverrideFieldConversions())) {
     field.setQuickFinderClassNameImpl(
         maintainableFieldDefinition.getOverrideLookupClass().getName());
     field.setFieldConversions(maintainableFieldDefinition.getOverrideFieldConversions());
     field.setBaseLookupUrl(LookupUtils.getBaseLookupUrl(false));
     field.setReferencesToRefresh(
         LookupUtils.convertReferencesToSelectCollectionToString(
             srr.getAffectedReferencesFromLookup(businessObject, attributeName, "")));
     return field;
   }
   if (maintainableFieldDefinition.isNoLookup()) {
     return field;
   }
   return LookupUtils.setFieldQuickfinder(
       businessObject,
       null,
       false,
       0,
       attributeName,
       field,
       displayedFieldNames,
       maintainableFieldDefinition.isNoLookup());
 }
 /** @see org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#getRows() */
 @Override
 public List<Row> getRows() {
   List<Row> rows = super.getRows();
   for (Row row : rows) {
     for (Field field : row.getFields()) {
       if (field.getPropertyName().equals("person.userName")) {
         field.setFieldConversions("principalName:person.userName,principalId:personId");
       }
     }
   }
   return rows;
 }
  public static final Field setFieldQuickfinder(
      BusinessObject businessObject,
      String collectionName,
      boolean addLine,
      int index,
      String attributeName,
      Field field,
      List<String> displayedFieldNames,
      Maintainable maintainable,
      MaintainableFieldDefinition maintainableFieldDefinition) {
    if (maintainableFieldDefinition.getOverrideLookupClass() != null
        && StringUtils.isNotBlank(maintainableFieldDefinition.getOverrideFieldConversions())) {
      if (maintainable != null) {
        String collectionPrefix = "";
        if (collectionName != null) {
          if (addLine) {
            collectionPrefix = KRADConstants.MAINTENANCE_ADD_PREFIX + collectionName + ".";
          } else {
            collectionPrefix = collectionName + "[" + index + "].";
          }
        }
        field.setQuickFinderClassNameImpl(
            maintainableFieldDefinition.getOverrideLookupClass().getName());

        String prefixedFieldConversions =
            prefixFieldConversionsDestinationsWithCollectionPrefix(
                maintainableFieldDefinition.getOverrideFieldConversions(), collectionPrefix);
        field.setFieldConversions(prefixedFieldConversions);
        field.setBaseLookupUrl(LookupUtils.getBaseLookupUrl(false));
        field.setReferencesToRefresh(
            LookupUtils.convertReferencesToSelectCollectionToString(
                maintainable.getAffectedReferencesFromLookup(
                    businessObject, attributeName, collectionPrefix)));
      }
      return field;
    }
    if (maintainableFieldDefinition.isNoLookup()) {
      return field;
    }
    return LookupUtils.setFieldQuickfinder(
        businessObject,
        collectionName,
        addLine,
        index,
        attributeName,
        field,
        displayedFieldNames,
        maintainable);
  }
  @Override
  public List<Row> getRows() {

    List<Row> rows = super.getRows();
    for (Row row : rows) {
      for (Field field : row.getFields()) {
        if (field.getPropertyName().equals(USERNAME_FIELD)) {
          field.setFieldConversions(FIELD_CONVERSIONS);
        }
        if (field.getPropertyName().equals(LOG_STATUS) && isLookupToCreateProposal()) {
          field.setPropertyValue(STATUS_PENDING);
        }
      }
    }
    return rows;
  }
 /**
  * Goes through all the rows, making sure that problematic field conversions are fixed
  *
  * <p>KRAD Conversion: Performs customization of the fields.
  */
 protected void convertOrganizationOwnerAccountField() {
   boolean foundField = false;
   int i = 0;
   while (!foundField && i < super.getRows().size()) {
     final Row r = super.getRows().get(i);
     int j = 0;
     while (!foundField && j < r.getFields().size()) {
       Field f = r.getField(j);
       if (f.getPropertyName().equals(CamsPropertyConstants.Asset.ORGANIZATION_CODE)) {
         f.setFieldConversions(fixProblematicField(f.getFieldConversions()));
         f.setLookupParameters(fixProblematicField(f.getLookupParameters()));
         foundField = true;
       }
       j += 1;
     }
     i += 1;
   }
 }