Page 1 of 1
TPgTable.RefreshOptions (roAfterInsert)
Posted: Thu 16 Apr 2009 18:04
by yapt
Why if I set PgTable.RefreshOptions to true I got an:
Exception
Invalid parameters specified
After a PgTable.Post ???
What I should configure/set to let this option runs fine ?
Greetings.
Posted: Fri 17 Apr 2009 13:23
by Plash
Are you assigning a value to the primary key before posting or you are using SERIAL column? If you don't set the primary key value, new record cannot be refreshed.
Posted: Fri 17 Apr 2009 15:33
by yapt
Sorry Plash, I forgot to clarify this.
My structrure was:
TableClients
MasterDetail
TableInvoices
MasterDetail
TableInvoiceLines
I was appending (on a transaction):
TableInvoices and (one or more lines) TableInvoiceLines.
But TableClients, in spite of was changing to the right client on application (TableInvoices.Append), was being pointed to old selected TableClients (clientId).
All was fine until post TableInvoices was executed. Then, TableInvoices selected record was returning to the set of TableClients (selected client).
Summary:
There was a bug.
But the error message showed by the refresh was not very clear. Perhaps an extended error message would be better. Ie: "record cannot be found (or refreshed) with this keys: .....,....,....,.....".
Thanks.
Posted: Tue 21 Apr 2009 07:36
by Plash
As I understand you add records to the detail table that do not match the key of the master table. So after you call Post these records disappear. You cannot refresh such record because it does not exist in the dataset.
Posted: Tue 21 Apr 2009 09:15
by yapt
yapt wrote:
Summary:
There was a bug.
Yes, I was meaning "There was a bug
ON MY OWN source code".
Thanks...