5 Replies Latest reply on Jul 26, 2018 2:09 AM by sprooney

    Calculation Not Quite Working

    sprooney Apprentice

      Next question, apologies...

      As part of a request process I require to show the current cost of an item prior to users purchasing (for display reasons we're unable to use the Service Catalogue).  So within the configuration item we have an attribute _Cost which is populated with a decimal of either 0.00 or something greater.

       

      On the request window we have a calculated attribute which is read only and should populate with the current cost of each item on the new request opening.  At the moment the request attribute seems to pick up an initial cost (the figure first entered in the service catalogue) and then it never seems to update again until the request is saved.

       

      The calculation is as follows and has been set to both 'After Read' OR 'Before Save' (doesn't appear to make a difference):

       

      import System

       

      static def GetAttributeValue(Request):

       

      Value = 0.00

       

      if Request._ConfigItemRequested._Cost != null:

       

      Value = Request._ConfigItemRequested._Cost

       

      return Value

       

      As you can see from the images below this displays different figures:

      Service Catalogue

      Request (note the 0.01 difference)

       

      Thanks,

      Steve