AnsweredAssumed Answered

iOS SDK Data Safety

Question asked by cril on Jan 26, 2019

I have a problem with running an app on the SDK. Every now and again it seems to forget something. For example the code below:

 

If [ Get ( FoundCount ) > 0 ]

Set Variable [ $check receipt before; Value:GUI::Message RefID ]

Set Field [ GUI::Message RefID; GUI::Message RefID + 1 ]

Set Variable [ $check receipt after; Value:GUI::Message RefID ]

If [ ($check receipt after - $check receipt before) ≠ 1 ]

Show Custom Dialog [ Title: "URGENT Receipt Number Error"; Message: "Please report that initial receipt was " & $check receipt before & " and final receipt was " & $check receipt after & " to xxxxxxx."; Default Button: “OK”, Commit: “Yes” ]

End If

Go to Record/Request/Page [ First ]

Set Variable [ $records; Value:Get ( FoundCount ) ]

Set Variable [ $counter; Value:1 ]

Loop

    Set Field [ Records for Export::MessageID Sent; GUI::Message RefID ]

    Set Variable [ $counter; Value:$counter + 1 ]

    Exit Loop If [ $counter > $records ]

    Go to Record/Request/Page [ Next ]

End Loop

End If

 

In here I'm selecting a set of records I want to send to my mac. GUI::Message RefID is an ID representing the package which my mac sends back confirmation that it has received those records. GUI::Message RefID is only changed in this piece of code. However my software does identify whether the confirmation matches the GUI::Message RefID. The response package on my mac works flawlessly. However sometimes after it has been incremented and assigned to all these records which confirms that the field has been correctly 'set' I find that the number being held in the iOS side has reverted to the previous number and hence it reports that an unexpected confirmation has been received. Examining the package being sent it has clearly incremented the field but on the iOS it has not, even though it was used!! For instance all the records being sent are now set to 10 and the data header received contains 10 and sends 10 back but GUI::Message RefID is still 9!

 

I'm completely flummoxed by this one so would really appreciate the help

Outcomes