RTC Forums

Subscription => Support => Topic started by: Filip D. on July 05, 2018, 11:02:41 AM



Title: Calculated Field preventing update
Post by: Filip D. on July 05, 2018, 11:02:41 AM
Hi,

I'm using the TrtcClientDataSet onDataChange event to trigger an update to the remote server.

I found that there is a calculated field preventing the update to go through.
The first time there is an update, all is well, the second time i update the same record, the update doesn't go through since the calculated field on the remote
server is updated automatically by the (firebird) sql database.  The TrtcClientDataSet on the client however still has the 'old' calculated field value.

I could modify the calculated field on the client to solve this but,
using the TrtcClientDataset.extractChanges, all fields are used to determine the the record to update (causing the problem),
Is there a possibility to limit this to use an unique-index instead of all fields (plus only send the modified field instead of all,would be nice, not essential)

Kind regards,

Filip Demuynck

PS: my initial post was in the wrong part of the Forum, sorry for that ;-)


Title: Re: Calculated Field preventing update
Post by: D.Tkalcec (RTC) on July 05, 2018, 11:57:39 AM
Just copy "TRtcDataSetRecorder" class implementation from the "rtcDB.pas" unit and "TRtcClientDataSet" class implementation from the "rtcDBCli.pas" unit and make your own version (in your own unit), which you can then modify to get all the functionality you need for your Project.

All the code in "rtcDB.pas" and "rtcDBCli.pas" units ("rtcSDK_DBA" package) exists ONLY AS EXAMPLES, to show you how you COULD work with DB-aware controls in Delphi when using the RTC SDK, but ... there are no plans to extend this functionality beyond what is already implemented.

In fact, I was thinking about removing these two units (and the "rtcSDK_DBA" package) from the RTC SDK a few times in the past (and the idea hits me again, every time someone comes with a question like yours), but I've decided to keep them for legacy reasons. They also seem to serve as a good starting point for anyone who might need such or similar components.

PS. If you look at the code, you will see that it's not very complicated.


Title: Re: Calculated Field preventing update
Post by: Filip D. on July 05, 2018, 12:32:17 PM
Thx for the info, i will defenitely look into it :-)

Kind regards,

Filip


Title: Re: Calculated Field preventing update
Post by: D.Tkalcec (RTC) on July 05, 2018, 12:42:02 PM
You're welcome. By the way ... the same goes for the Server side. In short, you should consider all the code from "rtcDB.pas" and "rtcDBCli.pas" units as EXAMPLES, which you can use for quick prototyping and/or to get your Project started, but will eventually want to copy into your own unit(s) as you move forward, so you can make any modifications you might need.