1 Reply Latest reply on Feb 7, 2013 6:24 PM by dmshimself

    Calculations to display field information in a task window

    Rookie

      I am trying to poplulate field information in a task and am having problems with the caculation. I have spoken to tech support and they have had me enter in the following information but it displays blank in the task. Any ideas, help would be very much appreciated. Thanks!

       

      import System
      static def GetAttributeValue(Request):

      Value0 = ‘’
      Value1 = 'New Request' + Request.Id + 'assigned'
      Value2 = '\r\nRequestor Name:' + Request.RaiseUser.Title
      Value3 = '\r\nEmail:' + Request.RaiseUser.EMailAddress
      Value4 = '\r\nPhone:' + Request.RaiseUser.Phone
      Value5 = '\r\nCurrent Status:' + Request.Status.Title
      Value6 = '\r\nCurrent Employee Information:' + Request._RequestedBy.Title
      Value7 = '\r\nDepartment:' + Request._RequestedBy._Department._Title
      Value8 = '\r\nJob Title:' + Request._RequestedBy._JobTitle
      Value9 = '\r\nEmail:' + Request._RequestedBy.EMailAddress
      Value10 = '\r\nPhone:' + Request._RequestedBy.Phone
      Value11 = '\r\nLocation:' + Request._RequestedBy._Location._Location
      Value12 = '\r\nEmployee ID:' + Request._RequestedBy._EmployeeID
      Value13 = '\r\nNew User First Name:' + Request._ADGivenname
      Value14 = '\r\nNew User Last Name:' + Request._ADSurname
      Value15 = '\r\nNew User Job Title:' + Request._ADTitle
      Value16 = '\r\nDate of Access:' + Request._DateofAccess
      Value = String.Format('{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16}', Value0, Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Value11, Value12, Value13, Value14, Value15, Value16)
      return Value

        • 1. Re: Calculations to display field information in a task window
          ITSMMVPGroup

          There are some good calculation articles and primers up here on the community, so I'd make sure you have used those,  in particular turning on TPS diagnostics for calculations.  If your local support team provide some initial suggestions, they might also be a good place to follow this up with.

           

          As a general comment I would make sure all the variables that you expect to contain data do actually contain it as often using a '+' will give an object reference error.  I'd also strip out everything except the first two value statements and get those to work, then add in the others one at a time until it breaks.