2 Replies Latest reply on Oct 22, 2010 10:36 AM by Stu McNeill

    How do I do "getcategoryobject" in calculations

    Apprentice

      I want to set a related category in a incident window with calculations.

       

      There is a function called ger ranked object. Is there a similar one to get a category?

       

       

      Thanks for all help!

       

      Göran

        • 1. Re: How do I do "getcategoryobject" in calculations
          Apprentice

          Is it even possible to at all set an category by using  Calculation+?

          I have tried everything but nithing seem to do the trick!

           

          Help!

           

          Göran

          • 2. Re: How do I do "getcategoryobject" in calculations
            Stu McNeill Employee

            Hi Goran,

             

            There is a known issue, problem 5018, that stops calculations from easily returning into a related object such as a category, reference list, user, group, etc.  This problem is fixed in 7.4.

             

            In the meantime there is a function you can use to lookup any object called GetNamedObject() which works as follows (in this example we're setting a User dropdown):

             

            Username = Incident.RaiseUser.Title

            return Incident.GetNamedObject("System.User", Username)

             

            The function is quite limited, it can only look up the item by its "Name" attribute (the attribute with "Is Name?" set to true in Object Designer).  In the case of a category object I believe this will be the attribute that only holds the last level of the name, so for a category called "Hardware - Laptop" you could look it up with this function using "Laptop".  However if you have other categories called "Laptop" at other levels in the hierarchy this won't work.

             

            I hope that helps.