5 Replies Latest reply on Jan 30, 2018 8:33 AM by Julian Wigman

    Calculations not storing to the database

    NickBrown Apprentice

      Hello -

       

      Running some simple calculations on resolutions objects, specifically on Incident. These are just determining the hours of an Incident. I'm looking to simply create these calculations and store them into our database so that our analytic tools can just pull this field in instead of calculating it itself. This should be simple. I have created a simple calculation that is calculating resolution creation date - incident creation date. This works fine and shows properly on the window where it's created and stored. However, when I go directly into the database to look for this field, it's showing up NULL. I've tried this with both Before Save and After Read configuration on the attribute and getting the same result.

       

      Can someone offer a KB article to explain this and how to resolve it? Sitting it on the window is nice, but it's not solving my problem.

       

      Thanks!

        • 1. Re: Calculations not storing to the database
          Julian Wigman ITSMMVPGroup

          The first rule is it needs to be BEFORESAVE type rather than AFTERREAD for the data to be stored in the DB.

           

          You say it works perfectly when tested in the calculation editor and that just proves the calc syntax and logic is OK.

           

          If it isn't storing data in the DB field then more likely you have your dependencies set wrong.

           

          Because you are basing on resolution then make sure the Resolution business object is present in the dependencies panel.

           

          Maybe post a screenshot if you are unsure.

           

          Julian

          MarXtar Ltd

          • 2. Re: Calculations not storing to the database
            NickBrown Apprentice

            Thank you Julian.

             

            To clarify it's working perfectly on the service desk window itself not just the calculation editor. As in, when I trigger a resoltuon on an Incident and save it I see the calculation run and display a time. When I then go query the database for that resolution I see the field NULL.

            • 3. Re: Calculations not storing to the database
              Julian Wigman ITSMMVPGroup

              As long as it is a BEFORESAVE calc and you can see on teh window then it should be in the DB too.

               

              It's difficult to help though without seeing screenshots of your calc and the query you are trying to run; are you 100% sure you are looking in the same place! 

               

              Julian

              MarXtar Ltd

              • 4. Re: Calculations not storing to the database
                NickBrown Apprentice

                I understand and would say the same thing!

                 

                I am sure because I found my very descript summary that I queried on.

                 

                 

                It's gotta be something silly and/or something stuck in IIS or something. I'm going to try rebuilding these attributes and start over, simple enough to do. I think I initially created these as After Read and as such something is "stuck" there. I'll try again. Thanks for the reassurance. I'll follow-up when I'm done.

                • 5. Re: Calculations not storing to the database
                  Julian Wigman ITSMMVPGroup

                  I'm also assuming you are null checking the Resolution Date in your calc too as obviously that'll be null until the Incident is resolved.

                   

                  Julian

                  MarXtar Ltd