waynemelrose Posted August 23, 2006 Posted August 23, 2006 Hi, I'm new to xml/xsl. I'm running FMSA 7 and have my databases ready, and already using some simple custom web publishing pages. (I got that far!) However now I just want to be able to make a simple edit function. I can't find any examples of a simple xsl file and I'm having trouble getting my head around the custom web publising guide from Filemaker. Could someone please help!? More specifically below. I would like to find a record with a field "JobNumber" and edit the contents of its field "ClientName" Any help would be appreciated. Wayne.
beverly Posted August 23, 2006 Posted August 23, 2006 Use the site assistant to set up some simple XSLT pages and study these for some clues. Also, to edit you have given us the steps you need to do: 1. -find the record you want 2. use the returned -recid to -edit Are you trying to do this in one step?
waynemelrose Posted August 23, 2006 Author Posted August 23, 2006 yes.. if possible? I have set up a simple site with the site assistant, and this is getting my through most things that i need to do, although I dont understand how the edit.xsl file works. everything else allows you to manipulate it with a URL and add your variable there. I have changed the output of the xsl file from html to xml, and im using curl to return the results of the request. So I am hoping that I can create a URL which will use an xsl file to edit or "submit" information in one step. Am I making sense?
Mikhail Edoshin Posted August 24, 2006 Posted August 24, 2006 It's probably possible but somewhat tricky, so it may be too complex. You cannot just order to FM to -edit a record that has some value in some field; you need to explicitly identify the record using the FileMaker own -recid parameter. So every standard editing process first finds the record(s) and then uses -recid's of the found record(s) for the -edit command. You could probably do this in one step, if you first submit the new value as a token. I.e. the query will look like page.xsl?JobNumber=XXX&token.x=new client name&-find The page will find the record and then silently submit another request using the document() function and the passed parameters, i.e. another-page.xsl?-recid=recid of the found record &ClientName=put your token here&-edit. This is not tested and not even experienced, but must work.
waynemelrose Posted August 24, 2006 Author Posted August 24, 2006 Hey thanks for the reply. OK, so I guess this was a hard question!? I can deal with these two issues seperately. so maybe I can ask to simpler questions. has someone got an XSL file where i can get the ID of a record from a find? so.. page.xsl?JobNumber=XXX&-find returns the record id then as someone got an xsl file that can edit a record given the record ID? As I said, I'm very new to this and learn from examples, although I cant find any examples of these things. If someone has got some code I would really REALLY appreciate it! thanks again wayne
Mikhail Edoshin Posted August 24, 2006 Posted August 24, 2006 Let's start with an empty HMTL page. The page will let you enter the job number and press the find button to find this job. Make a standard HTML page and add a form to it: Then make the "editclientinfo.xsl" file: <?xml version="1.0" encoding="UTF-8"?> version="1.0" xmlns:fmrs="http://www.filemaker.com/xml/fmresultset" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl fmrs" > <?xslt-cwp-query params="-grammar=fmresultset"?> Edit client info for job: To run smoothly you'll need a third file edit_client_info_confirmation.xsl, but it can be nearly empty at the moment. Here's a sample: http://www.mytempdir.com/883853
waynemelrose Posted August 24, 2006 Author Posted August 24, 2006 This is exactly what I was looking for! Thank you so much for your help, you have now put me on the path to learning how to use xsl! Much appreciated. Have a great day!
Recommended Posts
This topic is 6667 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