3 Replies Latest reply on Sep 30, 2010 9:21 AM by davidkelly

    query list


      Hi All,


      I have been asked to try set up some form of stock control on our comsumables through a query. the only way I could think of it was to have a caterogry with the toners/cartridges in it and I could make a query that will show that catergory in the resolution field. The only issue when making the query is I have to use the "is one of "  and add about 50/60 different entries.

      Really what i asking is has anyone tried anything like this and and am I right in thinking that I have no choice but to add in the 50/60 items or is there a better way.


      any help/ ideas would be great





        • 1. Re: query list
          Julian Wigman ITSMMVPGroup

          Hi David,


          I presume the 50-60 "is one of" entries are because these the consumables at the lowest level of the category tree?


          If you are on 7.3 or later you could maybe use calculated attributes to lesson this impact.


          For example I have 4 levels of categorisation and it was problematic for me that I could only put criteria on either the highest level (in tree) or the full path.


          So what I did was create 4 new attributes ("Level1" - "Level4") on the Category Business Object (In Incident in my case) and set them to be calculated.


          ie for Level 1:


          Type:  BeforeSave

          Calculation: import System
          static def GetAttributeValue(Category):
          Level = @/ - /.Split(Category.FullName)
          if Level[0]  != null:
              Value = Level[0]
              Value = ' '
          return Value


          Note here that split array ("Level") starts at pos zero (0) in example above so for Level 1 use 0, Level 2 use 1 etc etc to extract the correct element.


          Once you have these setup you can then use in your query criteria.





          1 of 1 people found this helpful
          • 2. Re: query list

            Hi Julian,


            Thanks for that ,I will give that a go , sounds good.


            Thanks again



            • 3. Re: query list

              Hi Julian,


              I gave your solution to our senior service desk crew but they couldnt understand it. I am away from the office for this week and next but was wondering if you could give me any help as to setting this up.

              They have never tried anything like this and any help would be great.

              I can do basic queries but leave this type of stuff to them.


              Cheers for all your help.