Home Service Manager Console App Feature Requests
We appreciate you taking the time to vote and add your suggestions to make our products awesome! Your request will be submitted to the community for review and inclusion into the backlog.

We recommend reviewing what is submitted before posting, in case your idea has already been submitted by another community member. If it has been submitted, vote for that existing feature request (by clicking the up arrow) to increase its opportunity of being added to Cireson solutions.

For more information around feature requests in the Cireson Community click here.

Outlook App - Able to Show and Use Parents

Candice_YeudallCandice_Yeudall Customer Advanced IT Monkey ✭✭✭
We would love to see the outlook app use parents, we had to stop using the app as we use parents a lot and the application was unable to properly deal with them.
5 votes

Submitted · Last Updated

Comments

  • Conner_WoodConner_Wood Customer Ninja IT Monkey ✭✭✭✭
    Last I heard from @chris_ross in Dec. 2015, it was on their roadmap but they were reworking activities at the time.

    If my code created in my own time below kick starts them into doing it sooner, that's why I posted it  >:)

    //Search Criteria for finding Parent Incidents

    Dictionary<string, string> searchCriteria = new Dictionary<string, string>();
    searchCriteria.Add("Active Parent Incidents", "Status <>'" + closedStatusEnum.Id.ToString() + "' AND Status <> '" + resolvedStatusEnum.Id.ToString() + "' AND IsParent = 1 AND DisplayName LIKE '%{0}%'");
    searchCriteria.Add("Recent Parent Incidents", "LastModified >='" + DateTime.Now.AddDays(-numDaysCasesRemainRecent).ToString("G") + "' AND IsParent = 1 AND DisplayName LIKE '%{0}%'");
    searchCriteria.Add("All Parent Incidents", "IsParent = 1 AND DisplayName LIKE '%{0}%'");
    searchCriteria.Add("Resolved Parent Incidents", "Status LIKE '" + resolvedStatusEnum.Id.ToString() + "' AND IsParent = 1 AND DisplayName LIKE '%{0}%'");
    searchCriteria.Add("Closed Parent Incidents", "Status LIKE '" + closedStatusEnum.Id.ToString() + "' AND IsParent = 1 AND DisplayName LIKE '%{0}%'");

    //Actual Search using criteria and "txtSearch.Text" (user input) for DisplayName

    //After selecting correct criteria and filtering by name.
    //Grab incident class
    ManagementPackClassCriteria incidentClassCriteria = new ManagementPackClassCriteria("Name = 'System.WorkItem.Incident'");
    ManagementPackClass incidentClass = emg.EntityTypes.GetClasses(incidentClassCriteria).ElementAt(0);
    //Create our searcher that brings us our possible parent incidents based off our criteria.
    EnterpriseManagementObjectCriteria criteria = new EnterpriseManagementObjectCriteria(String.Format(cboSearchCriteria.SelectedValue.ToString(),txtSearch.Text), incidentClass);
    IObjectReader<EnterpriseManagementObject> reader = emg.EntityObjects.GetObjectReader<EnterpriseManagementObject>(criteria, ObjectQueryOptions.Default);
    foreach (EnterpriseManagementObject emoParentIncident in reader)
    {
         //Create parent item in list that can be sorted accordingly.
         ListViewItem parentIncidentItem = new ListViewItem(emoParentIncident.Name);
         parentIncidentItem.SubItems.Add(TryGetEnterpriseManagementObjectPropertyStringValue(emoParentIncident, incidentClass, "Title"));
         parentIncidentItem.SubItems.Add(GetIncidentAssigneeName(emoParentIncident));
         parentIncidentItem.SubItems.Add(TryGetEnterpriseManagementObjectPropertyEnumValue(emoParentIncident, incidentClass, "Status"));
         parentIncidentItem.SubItems.Add(emoParentIncident.LastModified.ToString("G"));
         parentIncidentItem.SubItems.Add(TryGetEnterpriseManagementObjectPropertyStringValue(emoParentIncident, incidentClass, "Description"));
         //Add actual DateTime object to Last Modified subitem for future default sorting.
         parentIncidentItem.SubItems[4].Tag = emoParentIncident.LastModified;
         //Add GUID Id of emoSearchResult to our searchResultItem tag for future relationship!
         parentIncidentItem.Tag = emoParentIncident.Id.ToString();
         //Add our search result item to our Entity List!
         lstParentIncidents.Items.Add(parentIncidentItem);
      }
      lstParentIncidents.Sort();
      btnParentIncidentSearch.Enabled = true;
    }

    //Helper Function - Try Get String

    private string TryGetEnterpriseManagementObjectPropertyStringValue(EnterpriseManagementObject emo, ManagementPackClass mpc, string propertyName)
    {
                try
                {
                    return TryGetEMOPropertyValueAsString(emo[mpc, propertyName]);
                }
                catch
                {
                    //No value found, return it as an empty string
                    return "";
                }
    }
    
    
    private string TryGetEMOPropertyValueAsString(EnterpriseManagementSimpleObject emso)
    {
                if (emso == null || emso.Value == null || !(emso.Value is string))
                {
                    return "";
                }
                else
                {   
                    return emso.Value.ToString();
                }
    }

Sign In or Register to comment.