2 Replies Latest reply on Dec 8, 2016 8:23 AM by daveb1

    Change colour of CIs that are linked to an active incident

    stapletj@tbh.net Apprentice

      As we occasionally have several people log a call for a printer, for instance; I would like to put a list format on the CI tab that changes the colour of the CI if it is already linked to an active incident.

       

      This seems trivial, setting the formatting rule in the CI List to: $([Incident#.CIAssociatedActiveIncident]RecId != "")

       

      I get: Error: No relationship from CI# to Incident# has the relationship tag CIAssociatedActiveIncident

       

      I have that relationship configured. Is there a better way to go about this?

       

      Thanks.

        • 1. Re: Change colour of CIs that are linked to an active incident
          florian1 Expert

          Hi Jay,

           

          I assume it's a cardinality of n:m between CI & Incident?

          Because one CI can theoretically have n active Incidents and one Incident can have m active CIs.

           

          If it is I would rather go for a field on CI level like "hasActiveIncidents".

          Add a business rule to populate it, e.g.

          $(ChildFold("CI#", RecId, "Incident#.CIAssociatedActiveIncident", "1", "+"))

           

          Since your relationship is filtered this should be fine.

          • 2. Re: Change colour of CIs that are linked to an active incident
            daveb1 Apprentice

            Hi Jay,

             

            Could it be because you are not using the Internal Reference name of the relationship (listed just below the display name in the relationship definition)?  I thought that is what is expected after the period.  In my tenants, that relationship has an internal reference name of Active.  So the correct expression might be

             

            $([Incident#.Active]RecId != "")

             

            However when used, you get the warning, "The relationship [Incident#.Active] is 0-1 to many or 1 to many. Selection will choose a single object from among the ones available.", which I believe what Florian was alluding to.

             

            David