Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Framework » Key values change after popup call
Key values change after popup call [message #7330] Sun, 11 August 2019 08:40 Go to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Hi Tony,
after a popup call in a upd1 pattern the key values are changed. I want to insert the key values from the popup form as a foreign key. In the _cm_popupReturn function the key values in the $fieldarray as well as the values in the $select_array are fine. In my debugger I see that when returning the values from _cm_getForeignData in std.table.class.inc the key values are changed. Is it because I have the same names as key fields?
I attached the two dict files in the attachment in one file.
Re: Key values change after popup call [message #7331 is a reply to message #7330] Mon, 12 August 2019 03:54 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
When you return from a popup the default behaviour is for the column values in $select_array to be inserted into $fieldarray. This will cause the values for existing fields in $fieldarray to be overwritten regardless of whether they are part of the primary key, a candidate key or just foreign keys. If the fields being returned have one name, but you want to change them to another then you should do so in the _cm_popupReturn() method.

The _cm_getForeignData() method is designed to perform lookups on foreign key fields in order to retrieve additional data.


Re: Key values change after popup call [message #7332 is a reply to message #7331] Tue, 13 August 2019 05:46 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 439
Registered: May 2014
Senior Member
Now I understand and it works fine. The only thing I had to do was to change the values in $select_array into the original values (from $fieldarray) before returning $fieldarray at the end of the _cm_popupReturn() method. Thank you.
Re: Key values change after popup call [message #7333 is a reply to message #7332] Wed, 14 August 2019 04:52 Go to previous message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
It's easy when you know how Smile

Previous Topic: PDF - images in body / underlining 'label'
Next Topic: https-server not defined - Access denied
Goto Forum:
  


Current Time: Wed Nov 27 10:58:44 EST 2024

Total time taken to generate the page: 0.01029 seconds