12 Replies Latest reply on Apr 13, 2015 12:59 PM by Andrew Swindells

    Can  a group box be collapses as default? (aka how to add a Journal Function)

    Afzal.patel Apprentice

      We have a cool action which chronologically displays all the Notes, With Customer and Back from Customer information.   I am thinking of displaying straight on the main Incident & Request form, but I would like to place it into  groupbox which is collapsed as default, so the user is not presented with a huge form on entry.

      Is this possible?

       

      Thanks

       

      Afzal

        • 1. Re: Can  a group box be collapses as default?
          John Stuart-Robson Employee

          Hi Afzal,

           

          You could use a window calculation based on a tickbox on the incident/request form.  Have a boolean attribute on the window called show audit.  This will display your audit attribute.  To accomplish this, you would need to put the attribute in a groupbox on the form you wish to display, and set the attribute and label to Show On Window = false.

           

          The window calculation would look something like this:

           

          import System
          static def GetAttributeValue(Incident):
            HideAudit = true
            if Incident._ShowAudit != null and Incident._ShowAudit.ToString() == 'True':
               HideAudit = false
            return String.Format(":SetHidden(_ShowAudit, {0};",HideAudit)
          

          You would add the calculation and boolean attribute to the incident window. Set the boolean to be Calculate on change in the properties of the attribute.  You do not need to display the calculation attribute.

           

          The alternative would be to create a windowless action associated with a window.  Create a window specifcally for the Audit attribute. Create an action in process designer with associate with window set to true.  Create a view rule for that action/window combination.

          Modify the process and add that action in wherever you need to view the audit.

           

          I hope that helps.

          John

          • 2. Re: Can  a group box be collapses as default?
            Andrew Swindells SupportEmployee

            Hi,

             

            I would suggest using a windowless action with an incident (or request) form associated to it as John suggests.

             

            This is a neater way of presenting the information. The information is available to those that wish to see it by selecting "View Journal" (or whatever you wish to call it) but it isn't taking up space on any forms.

            1.png

             

            2.png

            • 3. Re: Can  a group box be collapses as default?
              Afzal.patel Apprentice

              Hi Andrew,

               

              I like the View Journal option, is it possible to share the code/documentation solution?

               

              Many thanks

              • 4. Re: Can  a group box be collapses as default?
                Andrew Swindells SupportEmployee

                Hi Afzal,

                 

                I have been working all week with other LANDesk customers and only really get time to update posts etc on Friday afternoon's.

                 

                Your project manager has raised this with your LANDesk sales person. I have sent the calculation that is required via that channel.

                • 5. Re: Can  a group box be collapses as default?
                  Jamie Cannon ITSMMVPGroup

                  Hey Andrew,

                  This journal calculation is very nice.  Is it a capture of various items in the audit log or is just checking various collections for content and populating if not null?  I'm a part of the channel in the States, I am with RennerBrown.. is this calc something you'd be able to provide me?

                   

                  [email protected]

                   

                  Thank you in advance if it's possible.

                  • 6. Re: Can  a group box be collapses as default?
                    Andrew Swindells SupportEmployee

                    Hi All,

                     

                    Sorry for the delay; I have been very busy!

                     

                    Firslty, you need to create a new collection related to the domain you wish to collate. For example, Incident Management > Incident. I call this 'Incident Journal' with an action of 'Add Journal'. You will also need a reference list object related to your journal object that contains an entry for each action you wish to collect. For example, Note Added, Assignment Made, Resolved....etc.

                     

                    Build the form. Update your process so that you have an 'Add Journal' action where you need to capture information. Similar to this:

                     

                    1.png

                    2.png

                     

                    You don't necessarily need to capture the details for each action. The import aspect is the Journal Action Type. I tend to capture the details for items such as 'With Customer' or Notes etc. But it is entirely upto you. The calculation checks if the Details of the journal entry is null so you have flexibility.

                     

                    You then need to

                     

                    1. Create a new windowless action in Process Designer – Set Window Associated = true (this is documented in the post on the community). Name it something descriptive – ‘View Journal’.

                    2. Create a String, -1, substring type = html attribute on the relevant object. Ie Incident. Create a before save calculation using the attached code. Set the dependencies to be the object that is collating the information; in the above this would be the 'Incident Journal'

                    3. Create a new window under for example, Incident Management > Incident and add the attribute created in step two (2).

                    4. Create a window rule to show the window in step three (3) when using the action created in step one (1).

                    5. Add the action created in step one (1) to each relevant status in the process as an optional action.


                    This is the calculation (Before Save) you need to add to the attribute created in step two (2):


                    import System
                    static def GetAttributeValue(Incident):
                      Value = ''
                      Value1 = ''
                      Value2 = ''
                      SortedJournal = List(Incident._IncidentJournalCol as Collections.IEnumerable)
                      SortedJournal.Sort() do (first, last):
                           return first._CreateDate.CompareTo(last._CreateDate)
                      LatestJournal = Incident._IncidentJournalCol.Latest()
                      if Incident._IncidentJournalCol.Count > 0:
                           Value = String.Format("<font size=4><strong>Incident Journal<br>Reference I:  </strong> {0}<br><strong>Current Status: </strong>{1}<br>", Incident.Id, Incident.Status.Title)
                      if Incident._IncidentJournalCol.Count > 0:
                           Value1 = String.Format ("<font size=3><strong>Latest Action:</strong> {0} <strong> Created: </strong> {1} <strong>By: </strong> {2}<br><hr>", LatestJournal._IncidentJournalAction1._IncidentJournalAction, LatestJournal._CreateDate.ToLocalTime(), LatestJournal._CreateUser.Title)
                      if Incident._IncidentJournalCol.Count > 0:
                           for a in SortedJournal:
                                Value2 += String.Format("<table cell padding='5'tr><td width=400><strong>{0}</strong></td></tr><tr><td colspan='6'><i>{1}</i></tr><tr><td width=350><strong>Created: </strong>{2}</td><td width=300><strong>By: </strong>{3}</td></table><hr>", a._IncidentJournalAction1._IncidentJournalAction, a._Details,a._CreateDate.ToLocalTime(), a._CreateUser.Title )
                      return String.Format("{0}" + Environment.NewLine + "{1}" + Environment.NewLine + "{2}", Value, Value1, Value2)
                    
                    
                    
                    • 7. Re: Can  a group box be collapses as default?
                      ITSMMVPGroup

                      This should be in the OOTB young Swindells!

                      • 8. Re: Can  a group box be collapses as default?
                        Andrew Swindells SupportEmployee

                        Couldn't agree more with you.

                        • 9. Re: Can  a group box be collapses as default?
                          plazz Apprentice

                          Great development Andrew. A question about performance - database size. Is before save better than after read? Could a case be made by using after read to keep all this info out of the database?

                          • 10. Re: Can  a group box be collapses as default?
                            Andrew Swindells SupportEmployee

                            Yes, create the calculation as a Before Save. After Read calculations can have performance implications.

                             

                            After Read calculations still write the output to the database.

                            • 11. Re: Can  a group box be collapses as default?
                              ma92675 Apprentice

                              Andrew,

                               

                              Could you go over the steps for that first part?  Been struggling with getting this to work correctly.

                               

                              "Firslty, you need to create a new collection related to the domain you wish to collate. For example, Incident Management > Incident. I call this 'Incident Journal' with an action of 'Add Journal'. You will also need a reference list object related to your journal object that contains an entry for each action you wish to collect. For example, Note Added, Assignment Made, Resolved....etc."

                               

                              Thanks!

                              • 12. Re: Can  a group box be collapses as default?
                                Andrew Swindells SupportEmployee

                                Hi,

                                 

                                You basically need to create a new object called Incident Journal (or whatever you wish!). Use the wizard to create this It is much quicker.

                                 

                                Then create a reference list related to the object created above.

                                 

                                Create windows for both.

                                 

                                Add entries to the reference list for each action in your process. For example: Note Added, Attachment Added etc.

                                 

                                Then add the automatic action using the object you created into the required areas of your process. You will need to do this for each action you wish to collate into your journal. My screen shot shows what I mean.

                                 

                                Hope that makes sense?