4 Replies Latest reply on May 20, 2016 7:15 AM by Stu McNeill

    Issue with dynamic window in BridgeIT

    GarethReeves Apprentice

      I have setup a dynamic window that shows two fields if the category is set to SAP. I have then setup two templates for the incident window one with no category set and one with the category preset to SAP.

       

      The template with no category set has been in use for a few years no issues in webdesk or BridgeIT. I have created two shortcuts using the two templates. these work fine in webdesk, one shows the additional fields as the category is preset and the other does not show the fields as the category is not preset, this is fine.

       

      In BridgeIT the template with the category set works fine the additional fields show no problem. The template with no category set that has been in use for years but now has the new field added that contains the dynamic window calculation. Now errors when opened.

       

      Internal Server Error

       

      Server Response:   Object reference not set to an instance of an object.


      I have found that if the Category is NULL this causes this error, if i set the category to anything the window opens. However we do not want the category set as this is a mandatory field that the Analyst has to select once the end user has logged the incident using BridgeIT.


      So i am assuming it is an issue with the calculation;

      import System

      static def GetAttributeValue(Incident):

        Hide = true

        Mandatory = false

        if Incident.Category.Title == null:

        Hide = true

        Mandatory = false

        if Incident.Category.Title == "SAP":

        Hide = false

        Mandatory = false

        return String.Format(":SetHidden(_SAPFuncList,{0});", Hide) + String.Format(":SetHidden(_Translation

       

      I have tried ==null and != "SAP" both error. Any ideas how i get this to work in BridgeIT, wondering if it is a bug as this works in Webdesk. Seems BridgeIT doesn't like category being null when the calculation runs, but can't see how to work around this.

       

      Any ideas?

       

       



        • 1. Re: Issue with dynamic window in BridgeIT
          Stu McNeill Employee

          Hey Gareth,

           

          Change your first "if" statement to exclude the ".Title" so it reads:

           

          if Incident.Category == null:

           

          That should fix the error when no category is set.

           

          Thanks

          Stu

          • 2. Re: Issue with dynamic window in BridgeIT
            GarethReeves Apprentice

            Stu

             

            Thanks, I tried that change The issue I had previous to this one is the calculation would not work at all with Incident.Category it would not match any category name. So I had to use category.title which allowed the decision i have in the process for Is category equals SAP to work. If I set the calculation to Incident.Category it does remove the error but the calculation and the decision do not work as it does not seem to return any value for Incident.category. Which is odd as a query on Incident.category does return a value!

             

            So it looks like the original issue of Incident.category not working is the issue. So any ideas on that appreciated.

            • 3. Re: Issue with dynamic window in BridgeIT
              JulianWigman Expert

              should be like this!

               

              import System

              static def GetAttributeValue(Incident):

                Hide = true

                Mandatory = false

                if Incident.Category == null:

                              Hide = true

                              Mandatory = false

                elif Incident.Category.Title == "SAP":

                             Hide = false

                             Mandatory = false

               

              return String.Format(":SetHidden(_SAPFuncList,{0});", Hide) + String.Format(":SetHidden(_Translation.....you didnt post the rest!

               

              • 4. Re: Issue with dynamic window in BridgeIT
                Stu McNeill Employee

                Great spot Julian!  Yes you need the "elif" (which is short for "else if" / "otherwise, if") to ensure the check on the Title is not done if the first "if" statement was true.