October 5, 201015 yr 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 October 6, 201015 yr by Guest Updated URL
October 6, 201015 yr 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)?>
October 6, 201015 yr 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) ?>
October 6, 201015 yr Author I found my solution. : http://filemakeraddict.blogspot.com/2009/07/setting-filemaker-timestamp-fields-from.html
October 13, 201015 yr 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.
October 13, 201015 yr 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…
October 13, 201015 yr 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