Skip 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.

Recording a timestamp when user edits a record

Featured Replies

I'm putting together a PHP based solution (largely generated from the FileMaker PHP Site Assistant) to allow customers easy access to their email marketing subscriptions. Here's an example link that the email recipient would click on to unsubscribe:

http://66.173.8.234/fmphp/subscriptions/browserecord.php?-action=browse&-recid=18594&contact_id=18615&[email protected]&campaign=Newsletter

I'd like to record a timestamp when someone updates their subscriptions so I can pull a report in a date period (like between newsletters). The auto-enter modification timestamp works, but it doesn't target a specific field so I can't rely on that. Is there a way to trigger a script when the user hits the "Save" button?

I can post my source code if that would be helpful. Thanks!

Edited by Guest
Updated URL

  • Author

<?php

echo '

';

echo 'Debugger Window

';

echo 'Record ID: ' . $recid . '

';

echo 'Contact ID: ' . $contact_id . '

';

echo 'Email Address: ' . $email . '

';

echo 'Campaign: ' . $campaign;

echo '

';

?>

Customer ID:

<?php echo nl2br(storeFieldNames('customer_id', 0, $record, true, 'EDITTEXT', 'number'))?>

Name:

<?php echo nl2br(storeFieldNames('full_name', 0, $record, false, 'EDITTEXT', 'text'))?>

Email Address:

<?php echo nl2br(storeFieldNames('email', 0, $record, true, 'EDITTEXT', 'text'))?>

Monthly Newsletter:

<?php

echo '

if (nl2br( $record->getField('newsletter_subscribed', 0))) { echo ' checked' ; }

echo ' disabled';

?>

Last Updated:

<?php echo displayTimeStamp(storeFieldNames('newsletter_subscription_last_updated', 0, $record, true, 'EDITTEXT', 'timestamp'), $displayDateTimeFormat)?>

  • Author

<?php

echo '

';

echo 'Debugger Window

';

echo 'Record ID: ' . $recid . '

';

echo 'Contact ID: ' . $contact_id . '

';

echo 'Email Address: ' . $email . '

';

echo 'Campaign: ' . $campaign;

echo '

';

?>

Customer ID:

<?php echo nl2br( $record->getField('customer_id', 0) ) ?>

Name:

<?php echo nl2br( $record->getField('full_name', 0) )?>

Email Address:

<?php echo nl2br( $record->getField('email', 0) )?>

Monthly Newsletter:

<?php $fieldValue = $record->getField('newsletter_subscribed', 0) ; ?>

<?php getInputChoices("checkbox", $layout->getValueListTwoFields('Checkbox', (isset($master_record)) ? $master_record->getRecordId() : $record->getRecordId()), $fieldValue, getFieldFormName('newsletter_subscribed', 0, $record, true, 'CHECKBOX', 'number'), 'number', $submitDateOrder);?>

Last Updated:

<?php echo displayTimeStamp( $record->getField('newsletter_subscription_last_updated', 0) , $displayDateTimeFormat) ?>

  • Author

I found my solution. :

http://filemakeraddict.blogspot.com/2009/07/setting-filemaker-timestamp-fields-from.html

So finally what is the scene?? Have you got the solution?? If yes then just close this thread and if not then tell us your problem.

  • Author

Well the solution is in the link I posted here, but if you need it spelled out, here's the exact code I used:

//  Record timestamp (http://filemakeraddict.blogspot.com/2009/07/setting-filemaker-timestamp-fields-from.html)

$user_update_request = $fm->newEditCommand($layoutName, $recid);

$user_update_request->setField('subscriptions_last_updated', date("m/d/Y h:i:s A"));

$user_update_result = $user_update_request->execute();

And I'm pretty sure you can't 'close a thread' on FM Forums…

Nice of you to post the code.

I'm watching Almeda, however, as s/he's posted several times without really offering any input, perhaps in an attempt to "share" the link to her website in her signature.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.