Forums: Lookup field without field saving - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Lookup field without field saving Rate Topic: -----

#1 User is offline   sol 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 28-May 18

Posted 14 June 2018 - 01:08 PM

I am wondering, if there is a solution for the following lookup issue without programming.

I have a main table "marina", assigning a city (FKcity) to the marina. The city is assigned to a country.

Posted Image

Listing the marinas, I join the tables "marina", "city" and "country".

Posted Image

Now comes the problem. When adding or editing a marina, I would like to be able to select the country first, in order to only have the cities of this country to choose for assigning to the marina.
But if I also use the country-field of the original query, PHPrunner says, that it can't save this field. Of course, as this field is not part of the "marina"-table.

This is how I would like to look the form like:
Posted Image

This way, it works fine, but I have no country-field to preselect the cities.
Posted Image

I am aware that having a "FKcountry"-field in the "marina"-table would help. But this would not be nice in terms of normalization. I hope, there is a way to realize this without programming...
Thanks for your help to a newbie in PHPrunner with no PHP programming knowhow (coming from Access-VBA-World).
Oliver
0

#2 User is online   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15840
  • Joined: 03-February 03

Posted 15 June 2018 - 02:02 PM

When you save your record make sure you are not trying to save fields from joined tables. For this purpose in events BeforeAdd and BeforeEdit remove fields from joined tables i.e.

unset($values["country"]);


More info:
https://xlinesoft.co...iple_tables.htm
Best regards,
Sergey Kornilov
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic