1 2 Previous Next 16 Replies Latest reply: Sep 21, 2013 10:26 PM by dmshimself RSS

    Pop Ups

    Nic Apprentice

      Does anyone know of any way to set a flag on a user which will produce a "pop up" when raising an incident in that user's name?

       

      Thanks

      Nic

        • 1. Re: Pop Ups
          dmshimself ITSMMVPGroup

          You can write a calcualtion that does this but it will only work in Console, not webaccess.  I can dig this out if that would work for you?  We use it to indicate if the raise user is a VIP.

          • 2. Re: Pop Ups
            Nic Apprentice

            Hi Dave, that would be brilliant if you don't mind, this is exactly why I need it here too....!

             

            Thanks

            Nic

            • 3. Re: Pop Ups
              dmshimself ITSMMVPGroup

              The calculation itself is pretty simple

               

              #VIP Alert#
              #BeforeSave#
              #Dependecy on raise user#
              import System
              import System.Windows.Forms
              static def GetAttributeValue(Incident):
              Value = ''
              Value = Incident.RaiseUser._CustomerFlag1._CustomerFlag
              if Value == 'VIP':  MessageBox.Show("Incident comes from VIP", "VIP Alert",MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
              return Value

               

              My attribute is on the incident object with this calculation is called Alert.  Note my use of manual dependencies here.  YMMV on the type of list or checkbox you have on raise user to detect if someone is such a person. I return this value so it can be painted on the screen as well.

               

              On the incident window itself, set the property for the attribute (Alert in my case) to have 'Is calculate on change' set to be true.

               

              I'd exit/go back in/iis reset and if all else fails reach for the TPS trace diagnostics!

              • 4. Re: Pop Ups
                Nic Apprentice

                Hi Dave, thanks for that, it's kind of made my head spin slightly, but I will try and give it a go....

                 

                Thanks

                Nic

                • 5. Re: Pop Ups
                  dmshimself ITSMMVPGroup

                  I understand.  Get Stus diagnostic guide handy and start with something simple!  I managed to get this implemented hands free at another site of ours, so you are in good company.

                  • 6. Re: Pop Ups
                    Nic Apprentice

                    Might be sounding a bit stupid now, but what is this guide?? ...

                     

                    Thanks

                    Nic

                    • 7. Re: Pop Ups
                      Stu McNeill Employee

                      I think Dave is referring to my calculation troubleshooting document here: Calculations Troubleshooting Guide.

                      • 8. Re: Pop Ups
                        elizabethcombrink Employee

                        Just to say that got an error message when trying to compile DMS's calculation until I spotted that the "import System.Windows.Forms" in the example which is not in the standard basic calc.  Then I was able to save the calculation.

                         

                        I was not however able to get it to work to generate a popup box - but I was trying to do it on a window to add a new collection item.

                         

                        And I'd think long and hard before exploring this more unless the popup actually works in WebDesk as well :-)

                        • 9. Re: Pop Ups
                          darren.bradshaw@durham.gov.uk Apprentice

                          We used the example Dave gave and it worked on our VIP Type Field, just to test the concept.

                           

                          We then tried this on the category field, so if a certain category is selected the analyst gets a popup window on their screen asking them something.

                           

                          Here is the code we used:

                           

                          import System
                          import System.Windows.Forms
                          static def GetAttributeValue(Incident):
                          Value = ''
                          Value = Incident.Category.FullName
                          if Value == 'Fault - Hardware - Miscellaneous' or Value == 'Fault - Network - Miscellaneous' or Value == 'Fault - Software - Miscellaneous':  MessageBox.Show("Are you sure you need to use a Miscellaneous Category?" + "\n" + "\nHave you checked the other Categories?", "Incident Category",MessageBoxButtons.OK, MessageBoxIcon.Question)
                          return Value

                           

                          We are looking into how we can use this on other categories and other fields.

                           

                          One thing we had to do though was to add the Calculation Handler (OnValueChanged) for the category field.

                           

                          I have attached another example.

                          • 10. Re: Pop Ups
                            dmshimself ITSMMVPGroup

                            Pop ups don't work in webdesk as far as I know Elizabeth :-(

                            • 11. Re: Pop Ups
                              hewy06 Expert

                              Hi Dave

                               

                              After stealing your code and a lot of faffing about finally have managed to get this to work.  It's brilliant , however am I doing something wrong as the OK on the popup box has to be clicked 3 times before it goes away???  No doubt it's me having done something completely stupid.

                               

                              Thanks

                               

                              Helen

                              • 12. Re: Pop Ups
                                dmshimself ITSMMVPGroup

                                Nothing springs to mind I'm afraid Helen.  I do have at least one client using this method, although they are migrating quite rapidly to WebDesk and hence have accepted this will not work any more.  About all I can think of is that for some reason the calculation is being fired off several times.  Perhaps a window copy rule into the same attribute with always execute set?  I'd turn on calcualtion diagnostics in the framework and see if that gives any clues.

                                • 13. Re: Pop Ups
                                  hewy06 Expert

                                  Hi Dave

                                   

                                  I had a copy rule set to always execute.  I've removed the always execute and now it's down to twice.  On my user window I have a boolean attribute (True/False) which is used to indicate whether the user is a VIP or not and then a copy rule to copy this info to a string attribute - think it was set up this way for the Incident matrix.  Anyhoo when I was setting up the calculation for the pop-up I tried to get it to query the VIP boolean attribute but it wouldn't work.  As soon as I got it to look at the string it worked but I have to ok the pop-up twice. 

                                   

                                  For your customer is it a boolean attribute you're checking in the calculation?  Should I be able to use a boolean??

                                   

                                  As always thanks for the help

                                   

                                  H

                                  • 14. Re: Pop Ups
                                    dmshimself ITSMMVPGroup

                                    1 down and 2 to go then :-)  Sounds like the Americas cup (go NZ Go!)

                                     

                                    In my case there is a drop down list on the customer table as that allows for different levels of VIP-ness

                                    1 2 Previous Next