ibiubu Posted June 7, 2002 Posted June 7, 2002 not quite sure how to implement this... I have some portal information I currently show on one of my web pages. I would like to make one of the fields from the portal be an active link that, when clicked on, goes to a new web page that contains CDML information to show data from the related record. Here is what I have so far that works. With my current configuration I can do a find on my web page, the find brings up a new web page with the CDML that shows the found data results from the correct record. This page also contains some CDML that shows informatin from a portal field. The portal CDML is configured thus: [FMP-Portal:Budgets] <span class="text"> <a href="[FMP-linkrecid: layout=Budgets, Format=budgets.htm]"> [FMP-field:Budgets::inty]</a></span> [/FMP-Portal] 1) The above CDML shows the portal line item field (inty) from the related record. 2) It also makes the line item from the portal a clickable link. 3) It directs that link to my new html page (budgets.html) that will contain all the CDML tags to show the data from the related database file/record. 4) It also shows what layout in the related file to use. What it doesn't do is 1) Indicate what the related database file is that the new web page (budgets.html) draws the data from. 2) Indicate what specific related record to pull the data from (my relationship between the 2 databases is based on a field named "Job #"). I am not quite sure how to include these 2 pieces of critical data in the link to make the budgets.html page show the data from the correct record in the related database. Any help would be greatly appreciated. LR
Garry Claridge Posted June 7, 2002 Posted June 7, 2002 You could write the full URL in the <a> tag; e.g.: [FMP-Portal:Budgets] <span class="text"> <a href="FMPro?-db=mydb.fp5&-layout=Budgets&-Format=budgets.htm&-recid=[FMP-CurrentRecID]&-find"> [FMP-field:Budgets::inty]</a></span> [/FMP-Portal] Hope this helps. Garry
ibiubu Posted June 8, 2002 Author Posted June 8, 2002 I tried using the above tag for my link: <a href="FMPro?-db=budgets.fp5&-layout=Budgets&-Format=budgets.htm&-recid=[FMP-CurrentRecID]&-find">[FMP-field:Budgets::inty] When I view the file thru the web the link from the portal information is active, but when I click on it I get the error "Record not found. The specified record could not be found." Apparently it is not finding the related record. I assume somehow [FMP-CurrentRecID] is somehow supposed to indicate what record is to show, but it is not working. How should [FMP-CurrentRecID] know which record to show? LR
The Bridge Posted June 8, 2002 Posted June 8, 2002 Instead of using -RecID in your link to the related record, do a -Find on the unique record key you've defined in the Budgets database. This field will have to be in the portal in order to work.
Garry Claridge Posted June 8, 2002 Posted June 8, 2002 Whoops! I went and checked a method I used about 12 months ago. I created a calculated field in the related file and called it 'rec_id'. It's contents were: Status(CurrentRecordID) so, I could use: &-recid=[FMP-Field:myportal::rec_id]& Hope this helps. Garry
ibiubu Posted June 9, 2002 Author Posted June 9, 2002 OK, now it makes sense. I almost have it. I am now using this tag structure...but it has now presented a new problem: <a href="FMPro?-db=budgets.fp5&-layout=Budgets&-Format=budgets.htm&-recid=[FMP-field:Budgets::SerialNumber]&-find">[FMP-field:Budgets::inty] SerialNumber is a field that is unique to each record in the related database. I have included this field in the portal. The tag above now uses SerialNumber to define which record to go to in the related database. The problem now is if that when I click on the above tag link, the new page doesn't just show the one record associated to the unique SerialNumber field, it is trying to show ALL records that are in the portal. Is there something else in the above CDML tag that needs to be included so that it only shows the one record clicked on in the portal with the matching SerialNumber instead of all the records in the portal? LR
The Bridge Posted June 9, 2002 Posted June 9, 2002 Heh... you're combining my option with garycl's. The CDML tag -RecID is the equivalent of FileMaker's Status(CurrentRecordID). Your two options: ...&SerialNumber=[FMP-Field:Budgets::SerialNumber]... or ...&-RecID=[FMP-Field:Budgets::RecordID]... In the second option, you'd simply have a calculation field called RecordID: =Status(CurrentRecordID). Hope that straightens it out for you.
Garry Claridge Posted June 9, 2002 Posted June 9, 2002 Is [FMP-field:Budgets::inty] unique to each row of the portal? If so, use that; e.g.: &inty=[FMP-field:Budgets::inty]&-find All the best. Garry
ibiubu Posted June 9, 2002 Author Posted June 9, 2002 OK, I really do understand how it is supposed to work... <a href="FMPro?-db=budgets.fp5&-layout=Budgets&-Format=budgets.htm&-SerialNumber=[FMP-field:Budgets::SerialNumber]&-find">[FMP-field:Budgets::SerialNumber] SerialNumber is a unique field to each record in the related database. The Field SerialNumber is included in the Portal. My web page I am looking at shows 2 related records in the portal. The link pulls up my new html page, but it still shows both (2) related records. If I am understanding the structure of the above CDML it should only be showing one of the records. Does the find part of [FMP-field:Budgets::SerialNumber]&-find"> need to be modified so it doesn't find all the records in the portal. Maybe adding something for exact match? Of course, this probably is not applicable in this situation. To get it to work, I had to go the other direction... <a href="FMPro?-db=budgets.fp5&-layout=Budgets&-Format=budgets.htm&-RecID=[FMP-field:Budgets::RecordID]&-find">[FMP-field:Budgets::inty] As suggested I added a field to my related database called RecordID. This field used the calculation Status(CurrentRecordID). I included this field in my portal. Now when the link is selected it shows only the one related record. YEA! not quite sure why the first option did not work. The second did it like a charm. This was one of those tougher CDML items. THANK SO MUCH FOR EVERYONES suggestions on this one. I learned a great deal from this one. I hope some other readers of these posts will also get some good from it. LR
Garry Claridge Posted June 9, 2002 Posted June 9, 2002 Certainly something strange about your '-SerialNumber' field! If each record of the 'budgets.fp5' file has a unique number in that field it should work just the same. Good to see that you are up-and-away anyhow. All the best. Garry
Recommended Posts
This topic is 8301 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 accountSign in
Already have an account? Sign in here.
Sign In Now