Page 1 of 1

Bug? 5.75: Does AG assume PK is always integer?

Posted: 2019-06-12 18:13
by onoehring
Hi,

I have setup a field as VarChar and PK in AppGini. The Rebuild Fields does not show any problems in the Admin-Area. But: When I try to add a record this error shows up (but the record is added to the table).
ec16.png
ec16.png (84.03 KiB) Viewed 2493 times
Olaf

Re: Bug? 5.75: Does AG assume PK is always integer?

Posted: 2019-06-12 18:31
by onoehring
Hi,

the problem also occurs, when I try to change (update) a record.

Olaf

Re: Bug? 5.75: Does AG assume PK is always integer?

Posted: 2019-06-12 18:34
by onoehring
Hi again,

when I try to delete a record (here with PK = yy ) also the error occurs ... which is strange, as the record should have been deleted already.

Code: Select all

Query:
SELECT * FROM ecomo_Lagerorte WHERE `ecomo_Lagerorte`.`ID_Lagerort_Kurz` = yy
This time, the record is not deleted.

Olaf

Re: serious Bug! 5.75: AG assumes PK is always integer!

Posted: 2019-06-12 18:46
by onoehring
Hi,
me again. The problem occurs on other tables as well making it impossible to use a non numeric field as primary key.

Please fix in the next version. .... This is some important bug I think.

Why do I want other fields than numeric as PK? At this time AG makes it quite hard to show additional information in a record. One has to create extra fields in the foreign table and use autofill lookup - which is also not very neat when you need a value from a third table in the select. It needs serious workarounds. So my solution is, make my text fields PK (works in my scenario) and I add a integer field which I populate with the "_before_insert" hook with the max number of that field +1 ... effectively creating my own numeric pk.

Olaf

Re: Bug? 5.75: Does AG assume PK is always integer?

Posted: 2019-06-13 09:35
by onoehring
Hi,

once again to this bug.
The bug occurs and makes hooks set in the _after_insert break... this function is not executed anymore.

Olaf

Re: Bug? 5.75: Does AG assume PK is always integer?

Posted: 2019-06-22 16:02
by a.gneady
Hmm ... AppGini doesn't assume that PK is always an integer ... You could try checking the Customers table from the online demo at https://bigprof.com/demo, where the primary key field is a VARCHAR and it's working fine. Is it possible to send me the AXP project file where this issue occurs please? You could use the support form at https://bigprof.com/appgini/support-request

Re: Bug? 5.75: Does AG assume PK is always integer?

Posted: 2019-06-23 05:04
by onoehring
Hi,

I sent the file.

Olaf