Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


jimlongo last won the day on July 12 2013

jimlongo had the most liked content!

Community Reputation

2 Neutral

About jimlongo

  • Rank

Profile Information

  • Gender
    Not Telling
  • Location

Contact Methods

  • Website URL
  1. Calculate only when required

    I took your suggestion and created a text field in a tab. When selecting the tab run a script that populates the field. Great solution. Thanks.
  2. I have a field in my database that displays the html of a google map with multiple locations. I only use it when I want to copy the html - to display pages on the web for board members to view. (sporadically) The problem is that every time I switch pages the field recalculates based on the records displayed, could be one or a few or thousands, and this makes the database very slow. Even if I'm not displaying the map (its tab is usually not active), this field is calculating the html. For now I've removed the field from the layout to alleviate the slow down, but i was wondering if there was a way to have the field but only have it do the calculation when requested. What's the best approach for that. A script button? or is there another way you would do it? Thanks.
  3. Trying to add some text to a query. For example here's a real simple calculation with a query that returns some text ExecuteSQL( "SELECT n_transactionAmountGross, t_transactionModel FROM Transactions WHERE FamilyID_CustomerID = ?" ; " : " ; "" ; FamilyID ) ) For a particular record it could return something like 100 : Membership 200 : Lesson I'd like to show the amount as currency. Even though the amount is a number in Filemaker, I assume that since the calculation is returning text the amounts are now a text string. So i'd like to prepend a dollar sign. But any number of operations like "$" + or Quote like used in the following don't work. I've tried it as a parameter using a variable as well. ExecuteSQL ( "SELECT " & Quote("$") & "n_transactionAmountGross, t_transactionModel FROM Transactions WHERE FamilyID_CustomerID = ?" ; " : " ; "" ; FamilyID ) ) Anyone have a solution for inserting text into a query? --------- BTW: Even if I was only returning the amount, and switched the calculation to return a number I cannot CAST the number as smallmoney which might be a solution. I guess ultimately whatever data the calculation returns will override the datatype returned by SQL.
  4. ExecuteSQL with variable

    Thanks for that eos, putting it as a parameter worked. Just to note, the underscore still causes a problem, and enclosing the field name with the space breaks it. Here's what eventually worked for me. Let ( yr = Year(Get(CurrentDate)) ; ExecuteSQL (" SELECT n_transactionAmountGross , t_transactionModel , t_LastName frmt FROM Transactions WHERE FamilyID_CustomerID = ? AND c_transDate_frmt = ? " ; " : " ; "" ; FamilyID; yr ) )
  5. Hi, I just started using this function, it's very helpful. I have a calculation that returns some transactions for this year. ExecuteSQL ( "SELECT n_transactionAmountGross , t_transactionModel , t_FirstName frmt FROM Transactions WHERE FamilyID_CustomerID = ? AND c_transDate_frmt = 2013 " ; " : " ; "" ; FamilyID ) ) I'd like to substitute the current year for the hardcoded year by using a variable, however this doesn't work. Let ( [ _yr = GetAsNumber (Year(Get(CurrentDate)) ) ] ; ExecuteSQL ( "SELECT n_transactionAmountGross , t_transactionModel , t_FirstName frmt FROM Transactions WHERE FamilyID_CustomerID = ? AND c_transDate_frmt = _yr " ; " : " ; "" ; FamilyID ) ) What simple thing am I missing here? Edit: came across the pinned topic that speaks to tables with underscores in the name and tried the suggestion from there to no avail . . . as well as just removing the underscore from the variable name, and also then trying to quote the variable. Let ( [ _yr = GetAsNumber (Year(Get(CurrentDate)) ) ] ; ExecuteSQL ( "SELECT n_transactionAmountGross , t_transactionModel , t_FirstName frmt FROM Transactions WHERE FamilyID_CustomerID = ? AND c_transDate_frmt = " & Quote("_yr") & "" ; " : " ; "" ; FamilyID ) ) Thanks, jim
  6. Get Nth Record in portal

    Maybe I figured it out, tell me if this sounds right. I can use GetNthRecord(field:Get(RecordNumber)) , it's that I have to evaluate the calculation in the context of the records that appear in the portal and not the records that are in the layout's table. That seems to work, Is that it?
  7. Is there a way to loop through the records in a portal, something similar to getting the next record in found set? GetNthRecord(field:Get(RecordNumber)+1)
  8. Send Mail not working

    Glad I could help. Someone helped me with a similar problem just the other day. Just a note for anyone trying to do this with a different email program. You may run into problems with the separator between email addresses. Mail.app can work with a list such as this with no separator, other programs (Outlook, etc.,) may require a comma or colon to separate the addresses. In that case use Substitute to change the carriage returns to the separator you require.
  9. Trouble in the layout mode

    I don't know if this is similar, but I recall this problem from a couple of years ago. http://forums.filemaker.com/posts/a5b30e2353
  10. Send Mail not working

    Hi Mike, you need to collect the addresses from the portal, store them into a variable and then address the email to that variable. In your script go to the first portal row, start a loop, set a variable that contains the email address field from your database Go To Portal Row[Select First] Loop Set Variable[$addresses; Value: List ( $addresses ; db::email )] Go To Portal Row [Select; Next; Exit after last] End Loop Then Send Email and use the variable $addresses in the email setup as the TO address. email_LOOP.fp7.zip
  11. Loop of Found Set inside Script for Web Viewer

    I see what you've done to build the array, (although it seems a little convoluted in FM speak) how the looping works. It does work - Thank You!
  12. Loop of Found Set inside Script for Web Viewer

    Yes that's precisely what I proposed. What I'm looking for is the "how to" dynamically build the array from the found set. As you stated, "dynamically build up part B with the addresses from the loop within a variable". What is the proper syntax to do that? Thanks.
  13. Loop of Found Set inside Script for Web Viewer

    In case my explanation is hard to understand here is the sample database with the 2 scripts. You should see the first script will display the map with pins. The second script will display the map, but the address array will be empty - so no pins. Maps.fmp12.zip
  14. I'm not sure if I have the right approach here. I want to display a google map with multiple pins according to a found set (and in another instance the contents of a portal). I have a script that builds some text/html using 3 Set Field statements. Each Set Field statement is just plain text. The Set Field is then displayed by a Set Web Viewer step into an Object. The 1st and 3rd steps are common javascript, the 2nd step is a javascript array of addresses which is hardcoded for now, but should eventually be constructed from the data in the found set. With the hardcoded array the script would product the following text which will display a multi-pin map. data:text/html,<!DOCTYPE html> <html><head><meta charset='utf-8'><title></title> <meta name='viewport' content='initial-scale=1.0, user-scalable=no'> <style type='text/css'> html { height: 100% }body { height: 100%; margin: 0; padding: 0 }#map-canvas { height: 100% }</style> <script src='https://maps.googleapis.com/maps/api/js?key=&sensor=false'></script><script> var geocoder; var map; function initialize() { geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng( 43.670234 , -79.386737 ); var mapOptions = { zoom: 11, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); var locations = [ '229 Ashworth Avenue, Toronto ON', '1112 Queen Street East, Toronto ON', '889 Yonge Street, Toronto ON', '1711 Melrose Avenue, Toronto ON', '2500 Yonge Street, Toronto ON', '45 First Avenue, Toronto ON' ]; var i; for (i = 0; i < locations.length; i++) { geocoder.geocode( { 'address': locations }, function(results, status) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location });});}} google.maps.event.addDomListener(window, 'load', initialize); </script> </head><body><div id='map-canvas'></div></body></html> What I am trying to figure out is how to replace the hard coded array of addresses in the middle with the data from looping through the found set I have tried something like this as the 2nd script step to build the array, but it is empty. Loop Go To Record/Request/Page [Next; Exit after last] Set Field [Map::HTML; GetFieldName(Map::address) & ", " & GetFieldName(Map::city) & ", " & GetFieldName(Map::province)] End Loop How should I go about this? Thanks.
  15. javascript not displaying in WebViewer

    Thanks Lee, Yes I realized my mistake in saying Advanced.

Important Information

By using this site, you agree to our Terms of Use.