Jump to content

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

Recommended Posts

Posted

Hi,

I'm completely new to CDML and have a few very basic questions.

Here is what I am working on:

I have a single file database and have been asked to create an online read-only report. The database is very simple, and the query will be the same except for the users name.

I have been given an HTML template entrance page with 30 buttons on it with a users name on each button. They want to be able to click the name and be taken to the report with their data displayed.

I need to know how to properly setup the files, or at least a nudge in the right direction and I'll come back if I have further questions.

Here is what I would like to do, but don't know how to go about it:

I would like to set the user name as a variable (token) and pass that to the results page and have the canned query run with the inserted token. If there are no matches, then a simple error page or dialog indicating the user doesn't have a report available at this time.

I'm also trying to be conscience about not duplicating code. I could easily "hard-wire" each query as a URL attached to each button, but it seems to me that there must be a more elegant way of doing this.

Lastly, I do have the results page working correctly. Currently I'm just the putting a FMP URL into the address to trigger the search, but want this done from the previous page based on which button was clicked.

ANY help would be appreciated. I search and searched the forum, but couldn't find a scenario that matched. But I did get everything else working thanks to the forum!

Posted

"I have been given an HTML template entrance page with 30 buttons on it with a users name on each button. They want to be able to click the name and be taken to the report with their data displayed."

Post the code for the template.

Posted

Unable, the code is ugly. Made in Frontpage. There is no functionality other than displaying buttons. The "buttons" are not even buttons. They are colored table cells with names in them. But I am to use it to "plug-in" the FileMaker code.

Anatoli, yes. There is no security required. The report created is a basic status report of projects the people are working on, and actually people may need to run other peoples reports.

Posted

what is the code that Front Page generated...is it just an html? .... 30 buttons....form buttons....txt links... :|?

sounds like:

Doc, Help me!

-ok I will, what is the problem?

Doc, I need help that is my problem!

hm....what is the Doc to do next? laugh.gif

Posted

Ok, let me try again. Sorry I was not clear.

I have an HTML table with 30 cells. In each cell is a name. I want to make each name a link that will trigger a search to generate a report based on a find using the name.

I could hard-wire each link with the search criteria and name, but I'm asking if there is a better way, and if so, what direction do I need to head in?

I'm using FileMaker developer 6. (Yes, I've been reading & using the CDML Reference & Tool, I'm just adept with it yet)

If I was looking for specific answers I think at this point my question would be:

Are tokens passed to an inline on a results page the best way to handle this?

Posted

The format file with the names could look like this:

[FMP-Record]

<tr><td><a href="FMPro?-db=reports.fp5&-lay=web&-format=reports.html&name=[FMP-Field:name]&-find">[FMP-Field:name]</a></td></tr>

[/FMP-Record]

This will automatically create links for the results page.

Hope this helps.

Garry

  • 3 months later...
Posted

Garry,

I've just copied and pasted your example into my own CDML page, replacing (obviously) the relevant fields, and it doesn't work. I keep getting a "no results returned" error even though I know there should be results. Here's the code:

<code>

[FMP-record]

<tr>

<!--

<td valign=top><font size=1>[FMP-CurrentRecID]</font></td>

<td valign=top><font size=1><A HREF="[FMP-linkrecid: layout=FormView, format=addropresults.htm]"><b>DETAILS</b></A></font></td>

-->

<td valign=top><font size=1>[FMP-field: CLIENT_NAME]</font></td>

<td valign=top><font size=1>[FMP-field: COMPANY_NAME]</font></td>

<td valign=top><font size=1>[FMP-field: UPLOAD_NAME]</font></td>

<td valign=top><font size=1>[FMP-field: UPLOAD_DATE]</font></td>

<td valign=top><font size=1><b>[FMP-field: PICKUP_SITE_ID]</font></b></td>

<td valign=top><font size=1><b>[FMP-field: PICKED_UP_IND] [FMP-If: PICKED_UP_IND.eq.Y]es</b>, at<br>[FMP-field: LAST_UPDATE_DATE][FMP-Else]O</b>[/FMP-If]</font></td>

<td valign=top><font size=1>[FMP-If: PICKUP_SITE_ID.eq.STAR]<b>Call 4787</b>[FMP-Else]Call 2717[/FMP-If]</font></td>

<td valign=top><font size=1><a href="FMPro?-db=addropFiles.fp5&-lay=FormView&-format=addropresults.html&-error=error.html&MEMBER_ID=[FMP-Field:MEMBER_ID]&-find"><B>SEARCH</B></a></font></td>

</tr>

[/FMP-record]

</code>

The idea is to be able to do a second search based on the results of a first search. This code is on the page for the results from the first search, and points back to itself as the format file. Is that bad? The entire thing is between <form> and </form> tags, FYI.

Posted

Robert,

Check the source in the browser after the first page has loaded. See what the URLs look like.

It looks OK from here! (Check this " [FMP-If: PICKED_UP_IND.eq.Y]es</b>").

You do not need <form> tags if you are using <a> tags.

Good Luck.

Garry

Posted

The URLs look like this:

<a href="FMPro?-db=addropFiles.fp5&-lay=FormView&-format=addropresults.html&-error=error.html&[email protected]&-find">

Could it be the @ symbol in the field that is causing the problem? If so, how the heck do I get around that? This FM database mirrors a MySQL database, and the primary field in the MySQL database consists of email addresses, all of which contain the @ symbol. Also, I have tried modifying the URL to put double quotes (") around the entire email address, such as:

<a href="FMPro?-db=addropFiles.fp5&-lay=FormView&-format=addropresults.html&-error=error.html&MEMBER_ID="[email protected]"&-find">

but I think that just screws up the URL altogether because the <a> tag using quotes for other reasons. I also tried the same URL with a different field (one without any symbols) and the URL works the way it's supposed to, i.e. a new search is executed and the results are returned properly. But ideally I would like to be able to use the MEMBER_ID field, which contains the @ symbol, so any suggestions how to do this are appreciated.

Also, about the <form> tags: Don't I need those in order to get FM to fill in the [FMP-Field] tags with the right info, or is that controlled by the previous page with the search form on it?

Thanks for your help on this, BTW.

Posted

Still no joy, Garry, but I'm working around it by linking two other fields in this manner. That way my users can still get the same info, though it does take them an extra mouse click to get it. I can live with that for now, and since they've never had the other functionality I'm sure they can, too!

Thanks for your help, though.

Posted

Terminology, FWIW.

Re:

"You can also try an "Exact Match", e.g.:

.html&MEMBER_ID='[email protected]'&-find">"

CDML Reference db > -Op:

"To specify the "Find Content Match" (==) operator..."

There is no value "Exact Match" listed under the -op tag.

FMPro db file > Find > Status Bar > Symbols:

"= exact match"

It has been my observation that using an "=" (exact match) enters the same search string (=datastring) and produces the same results as using the operator value "eq".

Another observation, "The code is too ugly to post..."

Eventually you posted your code - in spite of its ugliness. Go figure.

Posted

I apologize, I mis-wrote. Instead of "find content match" I meant to write "field content match".

That said:

"I usually use "-op" and "eq". It is much clearer."

Clearer than what, exactly.

It is my experience that if I am doing a search for the data string "Bob Jones" I will find every record which contains "Bob Jones" without an operator value. Further, if I do a search which includes the code "-op" and "eq" to search for "Bob Jones" I will get the same results. Basically, it is my experience that the operator value "eq" is both meaningless and useless.

Perform a search through your browser using of the operator value "eq". Now perform a search on the SAME DATA STRING using the operator value "bw". What, if any, are the differences in your results?

I have found the operator value "eq" to be rather rather meaningless and useless. I NEVER use it. Additionally, it and its results are quite different from the "field contents match" (==) and its results.

In point of fact, the "field contents match" is what one has if one will " "throw-in" an extra "=" " to the " "-op" and "eq" (=). It is much clearer." laugh.gif

One additional point of fact. the "exact match" value will not be sufficient to find with a data string which contains the special character @, especially as is used in the example above. Like I say, the "-op" and "eq" code is quite meaningless and useless. I NEVER use it.

Thank you for further establishing my point about terminology in using the correct operator value to achieve one's desired goals.

Posted

And then I realized I did not mis-write that line, I copied it directly from the CDMLRdb. The term "field content match" is taken from the Status bar of a db file under Symbols, which appears during a find operation.

Posted

Using "-op=eq" is clearer than attempting to add a "=" to a constructed URL. This is for distingushing an email addresse from field contents like this:

[email protected]

[email protected]

joe@bloggs

However, adding "==" is better for distingushing an email address from field contents like this:

1 [email protected]

[email protected] or [email protected]

[email protected] 2

[email protected]

All the best.

Garry

(I don't think Elvis has left the building!)

Posted

Just posted a demo of operator values and symbols usage in Sample Files, including the value eq and the symbol ==. Also a hardcoded range find.

Look for "CDML -Op values and Symbols demo"

laugh.gif

Posted

I know what has been bothering me about this, "Using "-op=eq" is clearer than attempting to add a "=" to a constructed URL."

What is clear is that one cannot add the value "=" using the tag "-op". That would be mixing metaphors. For the same reason one cannot use the field contents match using the tag "-op". If one does mix metaphors, the thing that is exceedingly clear is it just won't work.

As always you are right Garry. laugh.gif

This topic is 7861 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
×
×
  • Create New...

Important Information

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