Author Topic: Calculated field and track changes  (Read 2221 times)

KR

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 8
    • View Profile
Calculated field and track changes
« on: August 02, 2016, 12:03:08 pm »
Hello,

Please take a look at: http://jsfiddle.net/f2dzkymf/1/

I this grid I have a calculated field which gets updated automatically. I enabled track changes on the grid as well.

How do I get an update of the calculated field to be registered in the track log?

Thank you.




paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Calculated field and track changes
« Reply #1 on: August 02, 2016, 12:26:36 pm »
Track log is fetched by getChanges() method. http://paramquery.com/pro/api#method-getChanges

{updateList: Array[1], addList: Array[0], deleteList: Array[0], oldList: Array[1]}

Track log includes the computed  fields based on formula.

http://jsfiddle.net/f2dzkymf/2/

KR

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Calculated field and track changes
« Reply #2 on: August 02, 2016, 06:51:21 pm »
Thank you for your answer.

Yes updateList has the new values, but "oldList" has not the old value for the computed field.

It looks like "oldList" is not documented at all. Would you recommend not using it?

I was also expecting the red modified-flag on the computed field column.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Calculated field and track changes
« Reply #3 on: August 03, 2016, 04:05:06 pm »
oldList is not there in documentation as it's experimental only. So far it's not required in any use case. Please feel free to suggest if you feel oldList is indispensable for a specific use case.

red flag is not there on computed field as its changes are considered different from normal fields.