{"id":93,"date":"2008-08-07T18:09:52","date_gmt":"2008-08-07T17:09:52","guid":{"rendered":"http:\/\/simoncpage.co.uk\/blog\/?p=93"},"modified":"2009-01-04T04:38:29","modified_gmt":"2009-01-04T03:38:29","slug":"filemaker-out-of-office-function","status":"publish","type":"post","link":"https:\/\/simoncpage.co.uk\/blog\/2008\/08\/filemaker-out-of-office-function\/","title":{"rendered":"Filemaker | date format custom function"},"content":{"rendered":"<p>Today I decided to add some more functionality to the company database and create a consistent out of office reply function for all\u00a0of us (mainly as some either lack contact details or someone else to contact, which is important in most cases and this also speeds up the process).<\/p>\n<p>It&#8217;s basically just a calculated text field with a\u00a0lookup fields and about 5 entry fields feeding in.\u00a0You simply enter the core details:<\/p>\n<ul>\n<li>From (auto filled from account name but can be changed if, for instance,\u00a0a\u00a0secretary is updating)<\/li>\n<li>Period away till date<\/li>\n<li>Dropdown\u00a0of people in the company to add as a contact for urgent\u00a0matters\u00a0(optional and added in as a full name followed by contact details)<\/li>\n<\/ul>\n<blockquote><p>I setup the Out of office fields in another table related to the Contacts table. To add in the &#8216;people to contact text&#8217; I made the drop down displaying the names but the field just returns the contact&#8217;s ID from the database. The Out of office table is then related to the Contacts table via these ID fields and then a text field\u00a0within the Out of office table\u00a0is used as\u00a0a lookup to return the full\u00a0contacts details from a calculation field in the contacts table.<\/p><\/blockquote>\n<p>You end up with a\u00a0comprehensive Out of office text. On top of that I\u00a0added\u00a02 buttons &#8211; copy to clipboard and email me. Email me does a lookup of the account name and send the user an email containing the text (with optional note)\u00a0using the <a rel=\"nofollow\" href=\"http:\/\/www.scodigo.com\/\">SmartPill\u00a0PHP plugin<\/a>.\u00a0(The idea of this was so that if you want to set it up on your phone at a later date you can copy and paste it from that email).<\/p>\n<p>Whilst doing\u00a0this I setup a nice little custom function to do standard excel\/windows style\u00a0date formatting\u00a0(dd-mm-yy\u00a0\/ dd-mmm-yyyy)\u00a0for the period till field rather than hardcoding the date format.<\/p>\n<blockquote><p>\/*<\/p>\n<p><strong>Name:<br \/>\n<\/strong>DateFormating<\/p>\n<p><strong>Parameters:<br \/>\n<\/strong>theDate, format<\/p>\n<p><strong>Example:<br \/>\n<\/strong>DateFormating( get(currentdate); dd-mmm-yy) &#8211; returns 25-Dec-08<\/p>\n<p>*\/<\/p>\n<p>Let(dater = GetAsDate(theDate);<\/p>\n<p>Substitute(format;<\/p>\n<p>[&#8220;yyyy&#8221;; Year (dater)];<br \/>\n[&#8220;yy&#8221;; Right (&#8220;0&#8221; &amp; Year (dater);2)];<br \/>\n[&#8220;mmmm&#8221;; MonthName (dater)];<br \/>\n[&#8220;mmm&#8221;; Left (MonthName (dater);3)];<br \/>\n[&#8220;mm&#8221;; Right (&#8220;0&#8221; &amp; Month (dater);2)];<br \/>\n[&#8220;dddd&#8221;; DayName (dater)];<br \/>\n[&#8220;ddd&#8221;; Left (DayName (dater);3)];<br \/>\n[&#8220;dd&#8221;; Right (&#8220;0&#8221; &amp; Day (dater);2)]<\/p>\n<p>))<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Today I decided to add some more functionality to the company database and create a consistent out of office reply function for all\u00a0of us (mainly as some either lack contact details or someone else to contact, which is important in most cases and this also speeds up the process). It&#8217;s basically just a calculated text [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[4],"tags":[36,149,77,260,5,120],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/simoncpage.co.uk\/blog\/wp-json\/wp\/v2\/posts\/93"}],"collection":[{"href":"https:\/\/simoncpage.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simoncpage.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simoncpage.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/simoncpage.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":0,"href":"https:\/\/simoncpage.co.uk\/blog\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"wp:attachment":[{"href":"https:\/\/simoncpage.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simoncpage.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simoncpage.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}