Jump to content

brian rich

Members
  • Content count

    291
  • Joined

  • Last visited

  • Days Won

    4

brian rich last won the day on September 19 2014

brian rich had the most liked content!

Community Reputation

12 Good

About brian rich

  • Rank
    aging apprentice

Profile Information

  • Gender
    Not Telling
  • Location
    Hampshire, England

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. brian rich

    Developing with FM10 under WIN7.

    FWIW, I have an FMP10 database which manages a Club directory which I am presently running and maintaining on Win 8.1 as a single user solution - it started out on a Mac 6 years ago and has been through Win XP, Win 7 and Win 8 largely unscathed. I also have a stripped down version of this database which I distribute as a run-time version to a number of editors who use it on various flavours of Windows (Win XP, 7 and 8). This allows them to collate and update data which is then exported to update the data in my main FMP10 database. Everything appears to work as you would expect, and I have just 'published' the latest 72 page directory successfully last month from this database. I've not experienced any issues (such as those you mention) with this database. I assume that you have checked the integrity of the database using the recover option? if the database is fairly trivial as you say, then I think you can proceed with a reasonable degree of confidence as long as nothing changes. However operating systems have a habit of getting updates applied, so I would not look on FMP10 as a long-term solution. As it happens, in my case the FMP10 database will get deprecated this year because I'm handing over the directory publishing to someone else who wants to do it differently, so long life is not an issue. HTH Brian
  2. You can find the External Functions in a list when you specify a calculation - you should see something like this:   You need to selet the function set from the dropdown and then scroll down the list of functions to find the BaseElements functions  If you are getting a ? as the value returned, the most likely problem is that the OS filing system is returning an error. This is probably due to incorrectly specified file paths or a permissions error, or perhaps trying to execute the command on a drive that isn't recognised as a systems drive. If you set up a script similar to the one I suggested above, and step this through with the debugger, you should be able to determine if the paths you are requesting are valid. Start with a file on your desktop and work from there. One way of determining the correct path to insert is to use the BE_FileExists() command in the data viewer - for example: BE_FileExists ( "C:Usersbrian.richDesktoppart.mer" ) will give the value of 1 (TRUE) if the file part.mer is on my desktop.  Variables ARE accepted by BE. For example  Let(path = "C:Usersbrian.richDesktoppart.mer"; BE_FileExists ( path )) will also give the value 1  Sorry, I don't have a Mac to hand to give you some suitable examples using Mac file paths, and I haven't checked BaseElements on FMP13 yet, but I see no reason why it won't work.  You can find a Custom Function called FilePathToOS ( FMFilePath )  here: http://www.briandunning.com/cf/902 this may help resolve any path issues you have.  HTH  Brian
  3. brian rich

    Runtime and creating PDFs

    There are two possible routes you could explore - neither of them are trivial though. Using 360 Works Scriptmaster Plug-in with the iText library would allow you to create and manage PDF files, which I think is similar to the approach you would need with the MonkeyBread Plug-in that @Fitch suggests. With these plug-ins you would have to build the PDF pages from scratch, it's not possible to render them directly from a Filemaker layout, which is what the Save as PDF function does. The other possibilty is to look at a PDF printing product such as CutePDF, which acts as a virtual printer but produces PDF files rather than printed pages. However this would mean installing this as a separate entity which may not suit the way you want to distribute the run-time. Brian
  4. We had been experiencing issues with users who use short-cut key sequences where they were duplicating records using ctrl-D when trying to put Filemaker into Find mode using ctrl-F.  Our simple solution was to establish a custom menu set where the Duplicate Record option was removed from the Records menu, and set this as the default Menu Set for the file. Shortly after this change, one of our users reported that she could no longer save or edit Saved Finds as these options were now greyed out. Returning to the particular menu set, we found that there was an option to add [saved Finds] as a menu item, and the Saved Finds icon on the Status Bar worked as it does with the standard menu. However, we now have a new menu item between Windows and Help called Saved Finds.   We'd like to remove it - or hide it - but this doesn't appear to be an option as it isn't editable.  Is this possible (we are using FMP11)  TIA  Brian  Â
  5. filter(<textToFilter>;"0123456789.-") ?
  6. brian rich

    Transmitting a file by email

    Are you using .fmp as the extension? For Filemaker 11 it should be .fp7
  7. brian rich

    Properly Testing Backup files

    We run backups from our FMP11 Server every night. We were also concerned about how 'good' the backups were so thought it worthwhile checking the results each time the backup runs. To check the backups, we set up a 'robot' Filemaker machine which supports a special database writted for this purpose. Each night, we produce a second set of backup files which are empty clones on the databases (we were just looking for corruption in the file structure rather than the data, but there is no reason - except elapsed time - why you shouldn't check the full data file if you wish) . The robot copies these clones to it's own local storage. The robot program has a single table which holds one record for each database in the backup. For each record, it will run a 'recover' on the named database, which produces a recovery log file. It then pulls this log file into a text field and parses the log data searching for errors. It records basic details of any errors found, assigns a 'status' value based on the severity of the errors found, and when all files have been processed, emails the admin with the results. This has run for over two years now, and on a few occasions has reported a problem. This has allowed us to go back to the last but one back-up to recover a fully working version. By no means a perfect solution, but it does give us an indication of any problem in the integrity of the backups so we can immediately take action. No substitute I suppose for complete testing, but in our legacy system which runs 95 separate databases, (one is 35Gb in size), full testing of the backups every time would simply not be feasible, HTH Brian
  8. In the example I gave, yes, but I wanted to trap for other errors as well in the situation I was working in. In practice, to make sure that it was the trigger script causing the problem, I created the other layout and it was easiest to leave it in situ . I only noticed the problem when I was stepping through the failiing code in the debugger and saw that although the found set was empty, the last error code was 0. The point of interest for me is how to trap errors in this kind of situation. Brian
  9. I was puzzled when a test for a script error failed in the following situation: Set Error Capture [On] Go to Layout ["Billings" (Billings)] Enter Find Mode[] Set Field [billings::InvoiceDate; Date(1;1;1900)] Perform Find [] Set Variable[$error; Value:Get(LastError)] If [$error > 0] Exit Script [Result:TRUE] End If The problem was that in some cases the Find found no records, but the $error variable remained empty. The problem was traced to a trigger script attached to the layout Billings, which was set to trigger on Record Load. The trigger script has the effect of 'swallowing' the error code generated when the Find fails, and by the time control returns to the Set variable step following the Find, the get(LastError) function returns a value 0. The easy solution was to create another layout based on Billings which had no script triggers associated with it and carry out the Find on that layout. However I'm intrigued where else trigger scripts can cause a similar problem and if there is a way of catching the error before the trigger script runs. Ideas? Thanks Brian
  10. brian rich

    Error 100 only occurs when script runs on Server

    Update - Just found myself with the same problem again on our Filemaker 11 server (Windows), an import script that worked every time when run client-side fails when running server-side. The error reported is error 100, file is missing. The fundamental issue is that you do not appear to be able to export or import anything other than text based file formats when running a server-side script. This is true even if the table you are importing from is in the same database, the error 100 still occurs. (What caught me out this time!) The workaround for this is to export the data as a text file using CSV, TXT or MER formats; FP7, Excel, HTML, DBF, XML formats do NOT appear to work - all generate the error 100. (If you need to export/import repeating fields, this is supported if you use the MER format) You can only use the servers document or temporary folders as a place to store the export files, but this is easily referenced using get(documentsPath) or get(temporaryPath) to build the file path. There is no need to delete existing files of the same name, they are simply overwritten. Edit: One other issue to be aware of if you are not using US system formats is that FMP11 server does NOT respect regional settings on the server, so when you import your text file of data, dates in the non-US format dd/mm/yyyy will end up with the dd and mm fields transposed. You will need to post-process after the import to correct this. If the script has to be available both client-side and server-side, then you'll need to apply the above post-processing conditionally as the transposition doesn't occur on the client. Can anyone confirm if the situation has changed with FMP12 or FMP13 servers, or are we still limited to text file formats? HTH Brian
  11. It looks as though you have Set Error Capture [on] in your script, so if you were to test the value of get(lastError) immediately after the New Record step, you would know if the new record step worked or not. Why do you need to do the search in Installations to determine if there is a relevant record for the contract? If the Contracts and Installation tables are related using Contract_No, then a test for count(Installation::Contract_No) > 0 from the Contracts layout would tell you if there is already a related installation record. If you allowed creation of records via this relationship, then you would be able to add a new installation record by simply writing a value into one of the installation record fields from the context of the Contracts layout, e.g. set field[installation::_timestamp; get (currentTimestamp)] You can do your get(lastError) test immediately after this step to check if the new record was successfully created. Brian
  12. brian rich

    Linear or fractional ?

    Assuming that the algebraic equation is being passed as text, you could write a custom function which would evaluate to TRUE if it were fractional, as follows: Fractional (myEquation) defined as Case(patterncount(myEquation;"/") > 0;True;False) However, I suspect the issue is more difficult than simply looking for the / character as the algebra gets more complicated? Brian
  13. I have a sales order processing database where each sales order line has a number of records related to it. The related records have several date fields and from the context of the sales order line, I need to be able to establish the latest date in each of these date fields and store it in the sales order line for use later. I chose to write a custom function to which would determine the latest date in a list of dates, so I could evaluate each set of related dates in turn. To work out the latest date in the list, I decided to turn the list of dates into numbers using the getAsNumber() function, finding the largest number in the list and converting it back to a date again using the getAsDate() function. I then included this calculation in a script the would run through the selected order lines and evaluate the latest dates from the records Now I'm in the UK, so our 'normal' date structure is dd/mm/yyyy. When I run the script on an FMP11 Client, using a UK regionalised version of Windows 7, the calculations work as expected and the sales order lines end up with the correct latest dates. If I run the same script on the server, the latest dates either end up transposed or indeterminate. For example if the latest date is 12th March 2014, the result from running on the FMP client is 12/03/2014 whereas the result from the server is 03/12/2014 (3rd December 2014 in UK speak!). If it were 25th March 2014, the server returns ? It appears that the server doesn't respect local regional date settings and will always use the US date formats. A bit of Googling suggests that this has been an issue for other non-US users, although I can't find a solution explicitly referenced in these forums or on Technet Is this the case, and does this problem persist through to FMP12 and FMP13 servers? If so is there a way to reliably determine the date settings on the current platform, so it is possible to know which 'result' I am going to end up with and translate accordingly? I'd setting for a platform independant way of doing the calculation as an alternative. Thanks Brian
  14. Could someone clarify the precise action of this setting when calling a script in a remote database that has this setting enabled? The specific scenario is as follows: Database A and Database B are two separate Filemaker databases hosted on the same Filemaker Server User has [read-only access] in both databases, using an identical account name. This should mean he cannot create a record directly in any table in either of the databases. Script 1 in database A has the "Run Script with Full Access Privileges" setting checked. Script 1 includes a perform script step which refers to Script 2 in database B Script 2 in Database B creates a new record in table Z, and has the "Run Script with Full Access Privileges" setting checked. If the user has Database B open and runs script 2 directly - it will create a new record in Table Z. If the user opens Database A and runs script 1, does script 2 run as though the user had run it directly in Database B or is it in some way limited by the privileges in one or both of the databases? I ask the question because I have a situation like this where the script B appears to fail if when the user is working with it, but using the users account and running under debug with Full Access privileges, it works correctly. Any suggestions welcomed. Brian
  15. brian rich

    Error 100 only occurs when script runs on Server

    No, they are all in the same folder 'Databases'. An earlier version of the data exchange file (the one receiving the imported data) is in the Removed folder which is in the 'Databases' folder, but the last modification on this is several weeks ago so I don't think it is active. I'm baffled - just ran the script ClientSide and it runs without a hitch. I may try rewriting the script again in case it has become corrupted. Thanks Brian
×

Important Information

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