<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title><![CDATA[Custom Functions How To & Help]]></title><link>http://fmforums.com/forum/showforum.php?fid/35/</link><description>General Discussions on developing custom functions with FileMaker Advanced</description><language>none</language><pubDate>Fri, 05 Mar 2010 23:15:06 GMT</pubDate><lastBuildDate>Fri, 05 Mar 2010 23:15:06 GMT</lastBuildDate><docs>http://blogs.law.harvard.edu/tech/rss</docs><generator>FusionBB 3.0 FINAL (www.fusionbb.com)</generator><item><title><![CDATA[Custom function for a Google API line chart]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213667</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213667</guid><description><![CDATA[ <strong><span style='color:gray'>The custom function library wasn't letting me upload anything for some reason so I'm doing it here. Included is a sample file so you can see it in action. Please check it out and let me know what you think.</span></strong><br />
<br />
<strong>Function:</strong> fnGoogleLineChart<br />
<br />
<strong>Parameters:</strong><br />
chtitle<br />
xtitle<br />
ytitle<br />
xfield<br />
yfield<br />
color<br />
<br />
<strong>Formula:</strong><br />
<em>//The chart will scale using the highest value at the top//<br />
<br />
Let ([<br />
YAxis=<br />
If ( MiddleWords ( FieldType ( Get ( FileName ) ; GetFieldName ( yfield ) ) ; 2 ; 1 ) = "number";<br />
<br />
"|" &amp; Round ( Max (yfield) - ((Max (yfield) / 10) * 9); 2 )<br />
&amp; "|" &amp; Round ( Max (yfield) - ((Max (yfield) / 10) * 8); 2 )<br />
&amp; "|" &amp; Round ( Max (yfield) - ((Max (yfield) / 10) * 7); 2 )<br />
&amp; "|" &amp; Round ( Max (yfield) - ((Max (yfield) / 10) * 6); 2 )<br />
&amp; "|" &amp; Round ( Max (yfield) - ((Max (yfield) / 10) * 5); 2 )<br />
&amp; "|" &amp; Round ( Max (yfield) - ((Max (yfield) / 10) * 4); 2 )<br />
&amp; "|" &amp; Round ( Max (yfield) - ((Max (yfield) / 10) * 3); 2 )<br />
&amp; "|" &amp; Round ( Max (yfield) - ((Max (yfield) / 10) * 2); 2 )<br />
&amp; "|" &amp; Round ( Max (yfield) - ((Max (yfield) / 10) * 1); 2 )<br />
&amp; "|" &amp; Max (yfield);<br />
<br />
Substitute ( List ( yfield ); "¶"; "|" ));<br />
<br />
XAxis=<br />
Substitute ( List ( xfield ); ["¶"; "|"] )<br />
<br />
];<br />
<br />
//all google api charts start with the following//<br />
<br />
"http://chart.apis.google.com/chart?" &amp; <br />
<br />
//chart type is a line chart//<br />
<br />
"cht=lc" &amp; <br />
<br />
//chart auto-resizes to the size of the web object named "linechart"//<br />
<br />
"&amp;chs=" &amp; GetLayoutObjectAttribute ( "linechart" ; "width" ) - 50 &amp; "x" &amp; <br />
GetLayoutObjectAttribute ( "linechart" ; "height" ) - 50 &amp; <br />
<br />
"&amp;chtt=" &amp; chtitle &amp; <br />
"&amp;chxt=" &amp; "x,x,y,y" &amp; <br />
"&amp;chxl=" &amp; "0:|" &amp; XAxis &amp; "|" &amp;  "1:|" &amp; xtitle &amp; "|" &amp;  "2:|" &amp; YAxis &amp; "|" &amp;  "3:|" &amp; ytitle &amp; <br />
"&amp;chxp=1,50|3,50" &amp; <br />
"&amp;chd=t:" &amp; Substitute ( List ( yfield ); "¶"; "," ) &amp; <br />
"&amp;chds=0," &amp; Max (yfield) &amp; <br />
"&amp;chg=0,10" &amp;<br />
"&amp;chco=" &amp; color<br />
<br />
)</em><br />
<strong><br />
Sample Input:</strong><br />
fnGoogleLineChart ( "Sales-Chart"; "Date" ; "Sales" ; DataBase:Date ; DataBase:Sales ; "0000FF" )<br />
<br />
<strong>Result:</strong><br />
<a href="http://chart.apis.google.com/chart?cht=lc&amp;chs=737x381&amp;chtt=Sales-Chart&amp;chxt=x,x,y,y&amp;chxl=0:|3/10/2010|3/11/2010|3/12/2010|3/13/2010|1:|Date|2:||66.7|133.4|200.1|266.8|333.5|400.2|466.9|533.6|600.3|667|3:|Sales&amp;chxp=1,50|3,50&amp;chd=t:511,446,230,667&amp;chds=0,667&amp;chg=0,10&amp;chco=0000FF" title="http://chart.apis.google.com/chart?cht=lc&amp;chs=737x381&amp;chtt=Sales-Chart&amp;chxt=x,x,y,y&amp;chxl=0:|3/10/2010|3/11/2010|3/12/2010|3/13/2010|1:|Date|2:||66.7|133.4|200.1|266.8|333.5|400.2|466.9|533.6|600.3|667|3:|Sales&amp;chxp=1,50|3,50&amp;chd=t:511,446,230,667&amp;chds=0,667&amp;chg=0,10&amp;chco=0000FF" target="_blank">http://chart.apis.google.com/chart?cht=lc&amp;chs=737x381&amp;chtt=Sales-Ch ...</a><br />
<br />
<strong>Description:</strong><br />
Use this function to define a custom web viewer within Filemaker Pro. The function utilizes Google API to create a simple X,Y axis line graph. The chart is limited to a single line. Basic knowledge of Google API will be needed if you intend to modify the function.<br />
<br />
In the example above, a database with 4 records in the found set containing the following data: <br />
<br />
[Date: 3/10, 3/11, 3/12, 3/13] &amp; [Sales: 511, 446, 230, 667]<br />
<br />
Would produce the following URL (copy/paste into your web browser to view the resulting chart):<br />
<br />
<a href="http://chart.apis.google.com/chart?cht=lc&amp;chs=737x381&amp;chtt=Sales-Chart&amp;chxt=x,x,y,y&amp;chxl=0:|3/10/2010|3/11/2010|3/12/2010|3/13/2010|1:|Date|2:||66.7|133.4|200.1|266.8|333.5|400.2|466.9|533.6|600.3|667|3:|Sales&amp;chxp=1,50|3,50&amp;chd=t:511,446,230,667&amp;chds=0,667&amp;chg=0,10&amp;chco=0000FF" title="http://chart.apis.google.com/chart?cht=lc&amp;chs=737x381&amp;chtt=Sales-Chart&amp;chxt=x,x,y,y&amp;chxl=0:|3/10/2010|3/11/2010|3/12/2010|3/13/2010|1:|Date|2:||66.7|133.4|200.1|266.8|333.5|400.2|466.9|533.6|600.3|667|3:|Sales&amp;chxp=1,50|3,50&amp;chd=t:511,446,230,667&amp;chds=0,667&amp;chg=0,10&amp;chco=0000FF" target="_blank">http://chart.apis.google.com/chart?cht=lc&amp;chs=737x381&amp;chtt=Sales-Ch ...</a><br />
<br />
How to use it:<br />
<br />
1)	The web viewer object must be named “linechart.” (View -&gt; Object Info)<br />
<br />
2)	The chart will auto-scale to the dimensions of the web viewer, however Google does not allow charts larger than 300,000 pixels. So a chart sized 500x600 pixels is fine, but 550x600 will not work.<br />
<br />
3)	You are able to provide a main title for the chart as well as titles for both the X and Y axis. If you do not want anything in those positions simply input “” for these variables.<br />
<br />
4)	The X Axis. The values for this axis are passed in the order that they are created. So if the 4 records in the example were created in reverse order starting with 3/13, the graph would read 3/13 -&gt; 3/12 -&gt; 3/11 -&gt; 3/10 (left to right). Keep this in mind if you need these values to show up in a particular order.<br />
<br />
5)	The Y Axis. These values must be numerical. The graph will auto-scale using the highest value passed as the top value on the chart. The numbers that actually appear along the Y axis will be the regular intervals between 0 and the highest number passed.<br />
<br />
6)	The last variable “color” will accept the hexadecimal value for the desired color of the line.<br />
<br />
7)     In order for the chart to show multiple records it must grab the data from a related table. Otherwise it will only show data from the current record.<br />
<br />
NOTICE: Because of chart size limitation it is possible to overcrowd the values along the X axis. It is best to try to limit the number of characters used for those values.<br />
<br />
This is my first attempt at making an easy-to-use chart solution. I am eager for feedback on how it can be improved or simplified. <br />
<br />
 ]]></description><pubDate>Fri, 05 Mar 2010 23:13:54 GMT</pubDate><enclosure url="http://www.fmforums.com/attachments/uploads/1267830740-fnGoogleLineChart.zip" length="12747" type="application/zip" /></item><item><title><![CDATA[Change  error massage text]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213576</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213576</guid><description><![CDATA[ How can i change this error massage "this action cannot be performed because this field is not modifiable" ]]></description><pubDate>Sat, 27 Feb 2010 22:37:57 GMT</pubDate></item><item><title><![CDATA[Help?]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213480</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213480</guid><description><![CDATA[ I am working with my co-worker, trying to make new databases for our new boss. The only problem is, neither of us have had to go "behind the scenes" on fm before. As we are learning, we are getting more confused about what our old boss has done with the db. We have 6 databases, that we want to open all together. Old boss had it set up where we opened "ART2006" and 4 db opened with it. Does anyone know how to make the 6 open togehter? ]]></description><pubDate>Fri, 19 Feb 2010 20:21:53 GMT</pubDate></item><item><title><![CDATA[Custom Function Riddle]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213430</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213430</guid><description><![CDATA[ Hi, I am relatively newbie with CF, and therefore need your help to make a CF which does the following (probably recursively):<br />
<br />
From a number field (AFM) which must be 9 digits long (e.g 070878254),<br />
<br />
1) Make a string using a Left(AFM;8) let's say for example 07087825<br />
2)Separate each of the 8 digits and multiply it with 2 raised to a force from 8 to 1 (counting backwards), and then add all together.<br />
That would be like:<br />
<br />
(0*2^8)+(7*2^7)+(0*2^6)+(8*2^5)+(7*2^4)+(8*2^3)+(2 *2^2)+(5*2^1)<br />
<br />
3)Finally, it would divide the resulting number with 11, and the remainder once again divided with 10.<br />
<br />
If the resulting number is equal to the last digit of the initial field (AFM)the function should return TRUE, otherwise FALSE.<br />
<br />
From what I am aware of, the 3rd step requires the use of the MOD function.<br />
<br />
I would really love to see how this can be implemented by a recursive function since I am trying to learn how to build similar ones. Otherwise, I understand I could break it down to digits derived from MIDDLE values digit by digit and then add all up.<br />
<br />
For the rest I remain by your assistance...<br />
<br />
<br />
<br />
 ]]></description><pubDate>Tue, 16 Feb 2010 20:06:11 GMT</pubDate></item><item><title><![CDATA[Help with Troi fileplug]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213414</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213414</guid><description><![CDATA[ I'm having a huge problem getting the troi file plug to behave. Can someone skype me and bail me out? Ive been breaking my head for 4 hours now and my brain is getting soft..<br />
skype - maccxoph<br />
 ]]></description><pubDate>Mon, 15 Feb 2010 22:25:42 GMT</pubDate></item><item><title><![CDATA[Summation on entered date range]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213404</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213404</guid><description><![CDATA[ Hi There, <br />
I'm new with FM10. I've created a data base to track daily Money Order sale. So everyday i enter the date and the sale of the day. i want to run an up to date total for that month and also look back previous month via enter two dates or enter the month. Please help.<br />
thank you,<br />
aesi <br />
 ]]></description><pubDate>Mon, 15 Feb 2010 13:03:07 GMT</pubDate></item><item><title><![CDATA["magical button" on a database that generates and autofills a new record on a DIFFERENT database]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213320</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213320</guid><description><![CDATA[ I am new here so please be patient.<br />
<br />
I have been assigned the task of creating a "button" in our quotes database that will open a new record in our invoicing database and autofill the fields with the quote data. <br />
<br />
In my first attempt, I created a new layout that autofills the information from a layout in the quotes database I titled "invoice"(the quotes database and invoice database are nearly identicle in layout anyway and the fields autofill among those layouts creating what I had thought would be an ideal solution...). <br />
<br />
After some colorful criticism about following task instructions, My boss had been very clear about that NOT being what he wanted. He then explained specifically that he wants a "button" that opens a new record in the invoicing database and autofills the information shown on that current quote where the "button" is located (this information has to be entered manually otherwise).<br />
<br />
Now, I can copy formulas and such from other databases we have and duplicate some reults but as of right now I am unaware of the ability to have a button generate a new record on a sperate database that is autofilled from the record in which the button is pressed.<br />
<br />
Since modification has to be done on existing databases, I cannot generate a new database from scratch (also would have been ideal for me). it simply needs to look the same with a "button" added to our quotes database.<br />
<br />
Now I am very familiar with MS office and excel and have worked with formulas and conditonal formatting, etc. on other programs. unfortunately, I have only been introduced to filemaker within the past year or so and although I can generate records and such, I have not been required to generate formulas or do any editing to the layouts themselves before now.<br />
<br />
If anyone out there has any ideas, any help would be greatly appreicated. ]]></description><pubDate>Tue, 09 Feb 2010 20:26:06 GMT</pubDate></item><item><title><![CDATA[Portal Calculations]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213183</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213183</guid><description><![CDATA[ I have a portal which lists the average rate of a product. Each row shows the average rate for a different year. I would like to add a field that calculates the percentage difference between the rate listed in each row i.e the % increase or decrease each year. I guess this is possible, but I'm not sure whether it has to be scripted or can be a calculation. Has anyone already implemented something similar? <br />
 ]]></description><pubDate>Mon, 01 Feb 2010 19:14:17 GMT</pubDate></item><item><title><![CDATA[External Custom Function File?]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213098</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213098</guid><description><![CDATA[ Is there a way (without making a plugin), to have a separate file with your custom functions in it?<br />
<br />
When I develop, I usually make lots of little handy custom functions, and rather than copy/pasting and possible errors popping up (that and not knowing if a solution has that custom function in it) around everywhere, is there a way to have a file which filemaker points to for custom functions?<br />
<br />
I always start off with shell copies for my solutions, but when you have quite a few on the go, and you rework a function or create a new one, it would be very nice and handy to have it available everywhere with little work .... ]]></description><pubDate>Wed, 27 Jan 2010 03:25:00 GMT</pubDate></item><item><title><![CDATA[Applying Custom function to existing data]]></title><link>http://fmforums.com/forum/showtopic.php?tid/213027</link><guid isPermaLink='false'>http://fmforums.com/forum/showtopic.php?tid/213027</guid><description><![CDATA[ I'm having trouble with a custom function that applies formatting to phone numbers.  For some reason this custom function is only applied to new data that I put into the phone number fields.  If I perform an import of data the formatting is not applied until I either add a digit or remove it and then readd it.  Is there any way to apply this formatting automatically across all of my phone numbers? ]]></description><pubDate>Fri, 22 Jan 2010 16:36:28 GMT</pubDate></item></channel></rss>