Page 1 of 1

How to get the ID of the last addition or editing line after the record?

Posted: Wed 17 Jul 2019 06:45
by dmytrodubrovin
How to get the ID of the last addition or editing line after the record?
I use visual components for online data editing (pgQuery, pgDataSet).

Code: Select all

procedure TUniForm11.UniButton2Click(Sender: TObject);
 begin
   PgDSFirm.DataSet.Append; 
 end;
 
 procedure TUniForm11.UniButton3Click(Sender: TObject);
 begin
   PgDSFirm.DataSet.Post;
   // Id need to get here!!!
 end;
Thank you all in advance!

Re: How to get the ID of the last addition or editing line after the record?

Posted: Wed 17 Jul 2019 10:49
by MaximG
You can use the DMLRefresh property to implement the behavior you described : https://www.devart.com/pgdac/docs/devar ... efresh.htm

Re: How to get the ID of the last addition or editing line after the record?

Posted: Wed 17 Jul 2019 12:38
by dmytrodubrovin
It is not clear how to use it. The documentation says nothing about usage. Could you share a usage example?

Re: How to get the ID of the last addition or editing line after the record?

Posted: Wed 17 Jul 2019 12:54
by dmytrodubrovin
Understood! Thank!!!!

Re: How to get the ID of the last addition or editing line after the record?

Posted: Thu 18 Jul 2019 05:02
by MaximG
We are glad that you found a necessary solution. Please don't hesitate to contact us with questions concerning PgDAC usage.