public static void UpdateByAPIFieldName(LoginUser loginUser, CustomFields customFields, int refID, string apiFieldName, string value)
        {
            value = value ?? "";

            CustomField field = customFields.FindByApiFieldName(apiFieldName);

            //if (field == null) throw new Exception("Unable to find field '" + apiFieldName + "'");
            if (field != null)
            {
                UpdateValue(loginUser, field.CustomFieldID, refID, value);
            }
        }
        public static CustomValue GetValue(LoginUser loginUser, int refID, string apiFieldName)
        {
            CustomFields customFields = new CustomFields(loginUser);

            customFields.LoadByOrganization(loginUser.OrganizationID);
            CustomField field = customFields.FindByApiFieldName(apiFieldName);

            if (field == null)
            {
                return(null);
            }
            return(GetValue(loginUser, field.CustomFieldID, refID));
        }