<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Arial","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#00A1DE;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#72C7E7;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Arial","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Arial","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-AU" link="#00A1DE" vlink="#72C7E7">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt">Hi Dancer users<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">I hope you can help me. I’m pretty new to Dancer and I’m trying to write a simple web service for note taking. The SimpleCRUD module looks perfect for my needs, but I need to add a timestamp to the record
that SimpleCRUD creates.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">From the documentation I assume the right way to do this is with the 'add_edit_row_pre_save' hook, but the code in that sub doesn’t seem to ever get called.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">simple_crud( <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> record_title => 'Log item',<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> prefix => '/crud',<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> db_table => 'prototype',<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> editable => 1,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-family:Consolas">editable_columns => [ qw( UFirstName ULastName Details Type KFirstName KLastName Outcome ) ],<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-family:Consolas">add_edit_row_pre_save => sub {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> my $row = shift;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> open TESTOUTPUT, ">", "TEST.txt" or die "$!";<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> print TESTOUTPUT "hello";<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> close TESTOUTPUT;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:36.0pt"><span style="font-family:Consolas">},<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">Does anyone have some sample code or tips on how to implement ‘add_edit_row_pre_save’ that they would be willing to share? My Googling turned up nothing.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">Many thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">Taps<o:p></o:p></span></p>
</div>
</body>
</html>
<pre></PRE>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Arial","sans-serif";
color:black'>See more with <a
href="http://www.deloitte.com/view/en_GX/global/index.htm"
target="_blank"><span style='color:#0066CC'>Deloitte</span></a>. </span><span
style='font-size:8.0pt;font-family:"Arial","sans-serif"'><a
href="http://www.deloitte.com/view/en_AU/au/news-research/media-releases/9f68f4021a001210VgnVCM100000ba42f00aRCRD.htm"
target="_blank"><span style='color:#0066CC'>2012 Employer of Choice for Women (EOWA)</span></a> and <a
href="http://www.deloitte.com/view/en_AU/au/about-us/awards/index.htm"target="_blank"><span style='color:#0066CC'>Inclusive Workplace of the Year (AHRI Diversity Awards)</a>.
</span></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Arial","sans-serif"'>
This e-mail and any attachments to it are confidential. You must not use, disclose or act on the e-mail if you are not the intended recipient. If you have
received this e-mail in error, please let us know by contacting the sender and deleting the original e-mail.<br>Liability limited by a scheme approved under Professional Standards Legislation. <br> Deloitte refers to one or more of
Deloitte Touche Tohmatsu Limited, a UK private company limited by guarantee, and its network of member firms, each of which is a legally separate and
independent entity. Please see <a href="http://www.deloitte.com/au/about" target="_blank"><span style='color:#0066CC'>www.deloitte.com.au/about</span></a> for a detailed
description of the legal structure of Deloitte Touche Tohmatsu Limited and its member firms.<br><br>