This topic is locked

one-to-one Lookup Hyperlinks

12/5/2005 11:13:32 AM
PHPRunner General questions
D
DarrenBowen author

Hi, I've been trying out phprunner and it can do some nifty stuff so I've got my company to order it.
However I want to be able to make a field in one table link to another. I think it's best if I describe this with an example.
I have a table Contacts and a table Companies, each contact is associated with one Company.
I use a lookup wizard under contacts so that I can choose a company from the companies table.
However when viewing a contact I would like to be able to click on the company name in the table and bring up the details of the company, such as address/website etc. (i.e. the view link for the company)
Is this possible? I'm happy modifying the php code but I'd prefer a soluton in the wizard as I like to go back and adjust a few things in the wizard from time to time.
Thanks

Darren.

Sergey Kornilov admin 12/6/2005

Darren,
you can use HyperlinkView type for your Contacts.CompanyID field on Formattingtab in PHPRunner.
Enter the following URL prefix in View formatdialog.

companies_view.php?editid=


and you'll see the hyperlink on resulting pages that will open an appropriate Company View page.

D
DarrenBowen author 12/6/2005

Thanks for the information,
however the view as hyperlink option doesn't appear to work if you have the edit as lookup wizard option enabled.
Is it still possible to achieve this?
For integrity I have company_id and company_name, when adding a contact you choose the company from a drop down, allows for nice navigation and avoids spelling errors etc.
Darren.

Darren,

you can use HyperlinkView type for your Contacts.CompanyID field on Formattingtab in PHPRunner.
Enter the following URL prefix in View formatdialog.
and you'll see the hyperlink on resulting pages that will open an appropriate Company View page.

Sergey Kornilov admin 12/7/2005

Darren,
you can modify SQL query on Edit SQL query tab in PHPRunner.

Change it to add an alias for company_id field.

I.e. modify it this way:

select

...

company_id,

company_id as company_link,

...

from Contacts


Then remove company_link field from Add and Edit pages and use Hyperlinktype to View it.

D
DarrenBowen author 12/7/2005

Thanks that's a neat trick that I didn't think of.
Darren.