3 Replies Latest reply on Jul 29, 2016 7:02 AM by yari.formaggio

    Workspaces, closed tickets and calculated fields

    Peter Weighill Specialist

      Bit of a long story this one, so bear with me.

       

      We've got an incident and request for with an attachment field on it, but only want it to show when there is an attachment there.

       

      So we have a Window Calculation field, with the following:

      AttachHidden = true

          if Incident._MultiAttachmentDocument != null:

         if Incident._MultiAttachmentDocument.Count > 0:
         AttachHidden = false

          return String.Format(":SetHidden(_MultiAttachmentDocument, {0});",AttachHidden)

       

      This then means that we need separate new and update windows, with the Window Calculation field only on the update window.

       

      Now, this means that the Calculated field sometimes ends up empty and if the incident/request is resolved/fulfiled and set to readonly, then when trying to open this ticket in workspaces results in a "Internal Server Error. Server Response: Object reference not set to an instance of an Object" message.   The odd this is though, that opening up the same ticket in selfservice works fine.

        • 1. Re: Workspaces, closed tickets and calculated fields
          yari.formaggio Rookie

          Hi Peter,

          I have already encountered this bug.

          I suppose you are on a 2016.1 release or older. This bug has been "partially" (then I'll explain you my point of view) fixed in the 2016.2 release.

          Regarding your problem you can implement a workaround by setting a default value in the window calculation field, for example:

           

               return String.Format(":SetHidden(_MultiAttachmentDocument, {0});",true)

           

          In order to set always hidden the field by default.

           

          However you will still have a problem in workspaces (and this is also the motivation to the word "partially") because when your process will reach a read-only status (for example an end status like "Closed"), workspaces will not evaluate/execute the window calculation. Let me do an example.

           

          SCENARIO 1:

          In your window the attribute "MultiAttachment" is hidden by default and you have a calculation like the one you have described above. Your calculation does not have a default value.

          Let's suppose you have a ticket with one or more attachments and so in your window the field "MultiAttachment" will be displayed because of the calculation.

          When the ticket is closed, the result depends on the LDSD version you have installed:

           

          2016.2:

          even if you still have attachments, the field will not be displayed because by default the field is hidden in the window and the calculation is not executed.

           

          2016.1 OR PRIOR:

          the 500 internal server error you have described above.

           

           

          SCENARIO 2:

          In your window the attribute "MultiAttachment" is shown by default and you have a calculation like the one you have described above. Your calculation have a default value: return String.Format(":SetHidden(_MultiAttachmentDocument, {0});",true)

          Let's suppose you have a ticket with one or more attachments and so in your window the field "MultiAttachment" will be displayed because of the calculation.

          When the ticket is closed, the result should be the same regardless the LDSD version you have installed:

           

          even if you still have attachments, the field will not be displayed because by default the calculation return a string to hide the field and the calculation is not executed with runtime values.

           

           

          To complete the information i give to you I alse have noticed that WebAccess writes the result of every calculation run into the related DB field, Workspaces doesn't. And I think that the bug is related to this behaviour. I have an open ticket with LANDESK support about this bug.

           

          Hope to be helpful.

          Regards.

          • 2. Re: Workspaces, closed tickets and calculated fields
            Peter Weighill Specialist

            Thanks for the reply.

             

            I've tried the default value option but as you say it doesn't really help.

            • 3. Re: Workspaces, closed tickets and calculated fields
              yari.formaggio Rookie

              I know, it is only a workaround to avoid the error. But at the moment there is not a real solution.