'#Event: NewData
#Event: NewData(changeList as list)
'when converting the downloaded data back into database items, create a list of what changed
Private Sub ser_BytesToObject (Success As Boolean, NewObject As Object)
...
For Each itemInstance As item In items
InsertItemIntoData(itemInstance, True)
addItemUserKeyToChangeList(itemInstance) 'new in 1.1
Next
...
End Sub
'when raising the NewData event, return the change list as a new parameter
Private Sub GetUser_NonQueryComplete (Success As Boolean)
If Not(Success) Then
Log("Error writing to database: " & LastException)
End If
' CallSub(mCallback, mEventName & "_newdata")
Dim tempList As List 'new in 1.1
tempList.Initialize 'new in 1.1
tempList.AddAll(changeList) 'new in 1.1
CallSub2(mCallback, mEventName & "_newdata", tempList) 'new in 1.1
changeList.Clear 'new in 1.1
End Sub
'new in 1.1
'track each change as just the user and key fields, not the whole data item
Private Sub addItemUserKeyToChangeList(itemArg As item)
Dim changeItem As changeType
changeItem.Initialize
changeItem.UserField = itemArg.UserField
changeItem.KeyField = itemArg.KeyField
changeList.Add(changeItem)
End Sub