Jump to content

Go to related record via an html page


Partha
 Share

This topic is 7426 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

I'm trying to figure out how to go to a related record via an HTML page served up by Web Companion (custom publishing). I can, of course, put the related data on a layout in the first file, and vie it through the '-lay' command.

Problem is, that the related record has its own related data that I can only view if I go to the related record in the 2nd file. I've tried the "-Script" command, but whether I reference the first or second file in the "-lay" & "-DB" commands, I get an error.

Any suggestions? shocked.gif" border="0

Link to comment
Share on other sites

Hi, hope this might help:

We had a web database which was a directory of companies where their products, branches, brand names, contacts etc. were all in related files. The companies could create or edit their details online.

The related files showed as portals on the main record detail, but I used "edit conacts" (etc) buttons to link to the related records. I just made it a search which had the record id (the relationship) embeded in it. Looked like this:

<FORM ACTION="FMPro" METHOD="post" target="_blank">

<P><INPUT TYPE="hidden" NAME="-DB" VALUE="contacts">

<INPUT TYPE="hidden" NAME="-Lay" VALUE="Layout #1">

<INPUT TYPE="hidden" NAME="-format" VALUE="forecourt/contactsf/search_results.htm">

<INPUT TYPE="hidden" NAME="-error" VALUE="forecourt/contactsf/search_error.htm">

<INPUT TYPE="hidden" NAME="-SortField" VALUE="contactseniority">

<INPUT TYPE="hidden" NAME="-SortORder" VALUE="Ascending"><INPUT TYPE="hidden" NAME="-max" VALUE="all"><INPUT TYPE="hidden" NAME="-lop" VALUE=AND>

<INPUT TYPE=image SRC="images/contacts.gif" NAME="-Find" WIDTH=90 HEIGHT=35 BORDER=0 ALIGN=bottom value="edit contact list"><INPUT TYPE="hidden" NAME="-op" VALUE=eq><INPUT TYPE=hidden NAME=companykey VALUE="[FMP-Field:companykey]" >

</FORM>

This worked fine for some really cruddy relationships (ported from Access !!!!) and let the user edit, create and delete in the related files - just make sure to carry the relationship field as a hidden value over into new records.

regards, Jeff

Link to comment
Share on other sites

A copy of what I wrote to Partha in an e-mail:

>Hi Partha

>

>It's hard to distinguish the problem without looking at your

>specific databases, but i'll give it a try.

>

>My way of doing what I think you want to do is using a set of

>InlineActions (or inlines if you use lasso) and send tokens with id

>numbers for the records which you need to show between the

>inlineactions. I believe it would work, even though it would require

>some work on your behalf.

>

>I hope it helps

>

>/William

(I post it here so that someone can comment on it)

wink.gif" border="0

[ June 08, 2001: Message edited by: iBib ]

Link to comment
Share on other sites

Partha,

I have made some assumptions based on your email and notes here. The comercials db has a one-to-one relationship with the brands db, and the brands db has a one-to-many relationship with the personnel db. That is one commercial has one brand, and one brand can have many people associated to it.

I use a frameset with two frames. The first frame lists the commercials and the related brands. The second frame lists the personnel related to the brand.

The tvc_brand_name field in the commercials db is a calculated field using the brand_id relationship to display the brand_name from the brands db.

This format file lists the Commercials and the related Brands:

<head>

<title>TVC List</title>

<meta name="generator" content="BBEdit 6.1.2">

<script language="Javascript">

function paxfmsub(brand) {

document.paxfm.brand_id.value = brand ;

document.paxfm.submit();

}

</script>

</head>

<body>

[FMP-Record]

[FMP-Field:tvc_name] <a href="javascript tongue.gif" border="0axfmsub('[FMP-Field:brand_id]');">[FMP-Field:tvc_brand_name]</a><br>

[/FMP-Record]

<form name="paxfm" action="http://10.0.1.2:1154/FMPro" method="post" target="tvc_pax">

<input type="hidden" name="-db" value="test_brand_pax.fp5">

<input type="hidden" name="-lay" value="allfields">

<input type="hidden" name="-format" value="tvc_pax_list.html">

<input type="hidden" name="brand_id">

<input type="hidden" name="-find">

</form>

</body>

My assumption that the 'brand_id' is the common key across all databases may not be similar to your data-structure, as is my assumption that a commercial has only one brand associated to it.

Hope this is heading in the right direction.

Garry

Link to comment
Share on other sites

Hi,

Getting all these replies is a great feeling. I've tried 2 of them, both work.

However, the commercials have one or more brands associated to them through the "Brand_ID", so I've finally taken the easy way of pushing the Brand_ID's to one or more searches in the brand file, and then showing the data through a layout in the brand file.

Thank you to everyone who responded, and helped me think this problem through.

Rgds

Partha

Link to comment
Share on other sites

  • 2 weeks later...

Thanks a lot to everyone who helped me out, especially Jeff who put up some of his pages, and pointed me in the right direction.

To put it in brief, I needed to go to a 3rd related file based on values from a second related file. Since there is no "Go to Related Record" in CDML, the workaround I did is picked up the values and sent them forward in a "-Find" http string linked to the 2nd level related file being displayed in my web layout

Link to comment
Share on other sites

Hi!

since you posted the original question, I've had to do just the same thing. I ended up with a simple link in the portal that looks like:

<A HREF="http://www.mydomain.com:591/myfiles/FMPro?-db=mydatabase&-format=record_detail.htm&-error=search_error.htm&-lay=layout1&-op=eq&recordkey=[FMP-field:status::recordkey]&-find"

where there's just a field embedded in the search.

works a treat smile.gif" border="0

regards, Jeff

Link to comment
Share on other sites

This topic is 7426 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.