2 Replies Latest reply on Aug 1, 2017 4:14 AM by tpratt

    How to force a SAVE operation before an Action with mandatory attributes

    tpratt Apprentice

      I have working processes with a number of Dynamic Windows calculations; to dynamically build the user data entry form. In order to ensure that the users "request something" the first attributes that build the window are set (by calculation to mandatory). There is one flaw that users seem to fall into more than we thought. The user MUST put something in the Mandatory field; however if they use the available process actions (like Submit to IT); they are prompted that the data has not been saved if in fact that is the case. If they simply ignore that warning - then the action is executed and the data is all lost (not saved - of course because the used did not do so).

       

      Anyone used any cleaver methods to force a save operation to occur? I suppose another calculation to read say a sequence number as the window is loaded - and then increment the number each time the window is saved. Then I can look at runtime to at least see if the current value incremented each time the mandatory field is changes is higher than on read. This seems a lot of checking just to force a save vs. giving the users the option to skip the save. Anyone know of how to either:

       

      * Force a Save (I doubt this exists)

      * Remove the option to ignore and continue (No) when the user seems the warning that there is unsaved data.

      * other clever ideas (or point me to the stupid OOTB solution).

       

      Thanks,

       

      Terry

        • 1. Re: How to force a SAVE operation before an Action with mandatory attributes
          andreas.lindner Expert

          Hi Terry,

           

          you can use a combination of features to 'help' your users saving the mandatory data:

          1. Use mandatory fields on your window, so that attributes have to be populated and saved. Using the View rules (4) you can even set different windows for different users and different actions. You can also put a simple text field onto your window and inform the unsers that filling in the mandatory data and saving will be necessary to select the next action (in relation with feature below).
            Window.png
          2. To "disable" the action (in the normal and the right-click menu) as long as the mandatory attributes have not been populated, use a precondition in your process (calculation for more attributes than one).
            Precondition.png

           

          Example Calculation for the above precondition:

          import System
          static def GetAttributeValue(Incident):
               Value = false
               A = 0
               U = 0
               C = 0
               
               CU = Incident.GetObjectByAttribute("System.User", "Name", Incident.GetCurrentUserName())
               if CU.UserType.Name == "Analyst":
                    A = 1
               if Incident.Category != null:
                    if Incident.Category.Parent != null:
                         C = 1
               if Incident._IncidentUrgency != null:
                    U = 1
               if A + C + U >= 3:
                    Value = true
          return Value
          

          In my case I'm using the same calculation for two almost similar preconditions. This calculation will check if the current user is an Analyst and if the Incident Category and Severity are populated. The only difference in my precondition is, that one will only offer the action if the outcome is "false", and the other one (not in the screenshot) only if the outcome is "true".

           

           

          Hope it helps!

          Andreas

          • 2. Re: How to force a SAVE operation before an Action with mandatory attributes
            tpratt Apprentice

            Thanks - this is very helpful ... sometimes seeing the trees thru the forest is not as easy as it sounds. Getting users to "read anything" is at best a 50/50 proposition in our organization - the information to be successful is already on the windows, linked instructions, etc. But the second they see "submit to IT" its time to push the button!

             

            I would likely create a looping action with the intent to "clue them in" - maybe that action would just say "Pending Save"; and then the process precondition could determine which of the 2 actions based on the mandatory data. I've done some reword to actually remove some of the windows rules that had different windows (ex - Read only vs read/write) for a more dynamic experience. I don't want to have no actions for moving the process forward - its too bad that actions can't inherit the "save" functionality or at least modify the warning dialog box the users never read (there is a reject action and an Assign Delegate action).

             

            Anyway - thanks for a quick and helpful reply.

             

            Terry