Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Update a Calculated Field



Permlink Replies: 1 - Last Post: Sep 24, 2014 12:20 AM Last Post By: Dmitry Arefiev Threads: [ Previous | Next ]
Martin Stratmann

Posts: 18
Registered: 5/26/00
Update a Calculated Field
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2014 5:56 AM
Hi,

I have a fkCalculated (or fkInternalCalc) Field names resident from my
SQL-Query "select * from customer. On TField::OnGetText I calculated the
field from the SQL data fields like so: customer_resident =
customer_countrycode + "-" customer_zip->AsSting + " " + customer_city +
", " + customer_state;

I want edit this field and on TField::OnSetText I want parsed it and
assign the parsed Values back to the sql data fields (countrycode, zip,
city and state) like:
TParseResident p(resident->AsString);
customer_contrycode = p.code;
customer_zip = p.zip; and so on.

The TDBEdit field display the value as I wanted, but the edit field is
read-only. Change the ReadOnly Property of the TDBEdit field doesn't work.

What is the best approch to do that?

Best Regards,
Martin
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Update a Calculated Field
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 24, 2014 12:20 AM   in response to: Martin Stratmann in response to: Martin Stratmann
What is the best approch to do that?

Move field calculation into TDataSet.OnCalcFields event handler.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02