Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

delete record with XSLT

Featured Replies

Converted CDML solution to XSLT using CDML Converter...

The solution includes a (URL) link for deleting a user,

but the user (record) is never deleted. Any ideas?

mywebsite.org/fmi/xsl/addusers/delsuccess.xsl?&-db=newusers&-lay=General&-recid=1254&-grammar=fmresultset&-delete

There are no errors, and the delsuccess file returns properly.

Please help!

Brian

Check /Library/FileMaker Server 7/Web Publishing/logs/pe_application_log.txt

Remove the & after the ?

mywebsite.org/fmi/xsl/addusers/delsuccess.xsl?&-db=newusers...

-->

mywebsite.org/fmi/xsl/addusers/delsuccess.xsl?-db=newusers...

Martin

  • Author

Ooopps! Thanks for catching that extra ampersand!

But this link, STILL, doesn't delete a record:

mywebsite.org/fmi/xsl/addusers/delsuccess.xsl?-db=newusers&-lay=General&-recid=1268&-delete

But, following the CWP manual, using this link DOES work:

mywebsite.org/fmi/xml/fmresultset.xml?-db=newusers&-lay=General&-recid=1268&-delete

However, the manual does not state how to get a return page

(so I can notify the user that the record has been deleted) ??

How do I get a return page? Like what the XSLT solution was providing?

Brian

No, it works also with XSLT publishing. But I needed some time to create a working test. And it was a good question to deal with the "magic" of FileMaker XSLT Publishing.

Try

http://www.clicaps2.ethz.ch/fmi/xsl/test...ay=WWW&-findall

Then click on the "add a record" link.

Then, on the resulting page, click on any "delete record" link, which deletes a record and sends you back to the originating page.

The db and the two XSLT files are attached in this post. Please study them. There are some special techniques in the XSLT like

- variables

- doing searches within the XSLT file with the document() function. In CDML, this corresponds to [FMP-InlineAction: ...], however, document() is much more flexible, and you can save its result in a variable

- concatting strings with concat()

- adding the current time to the URL so that the browser always loads the page from the server and not from its cache

There might be one reason why in your case the record is not deleted: The value for the recid that you use in the query does not correspond to the record-id, an internal database value of the record you want to address. You can get this value from the XML fmresultset tree, see line <xsl:variable name="recordid" select="$record/@record-id"/> in test_delete.xsl

Another feature is, that the resulting XSLT stylesheet always processes the XML result tree from the last action. E.g. if the action was -delete, the FileMaker XML result is empty (well it has some database metadata, still), of course, because the record was deleted. Therefore, if one wishes, one has to re-query the remaining records in the database with the document() function.

You can trace that in my example in the two XML result trees at the bottom of the page.

Martin

test_delete.zip

  • Author

Martin,

May I say that you went above and beyond here?

Thank you SO MUCH!! I am overwhelmed...

(to get so much support here, and so little help from FileMaker Support)

(I'm not blaming them... just wish they would offer fee-based custom solutions support)

The issue WAS with the resulting stylesheet!

I really need to learn more about XML/XSLT...

Thank you (once again) Martin.

Brian

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.