Sign in to follow this  
Followers 0

Recording a timestamp when user edits a record

7 posts in this topic

Posted (edited)

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=test@email.com&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
Updated URL
0

Share this post


Link to post
Share on other sites

Posted

<?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)?>

0

Share this post


Link to post
Share on other sites

Posted

<?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) ?>

0

Share this post


Link to post
Share on other sites

Posted

I found my solution. :

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

0

Share this post


Link to post
Share on other sites

Posted

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.

0

Share this post


Link to post
Share on other sites

Posted

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…

0

Share this post


Link to post
Share on other sites

Posted

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.

0

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0