Search Project Mgmt
Search FileMaker Blogs

Thank you for visiting the FileMaker Thoughts blog. I recently moved this content over from my blogger account. Hope you like it! When you get a chance, check out the centralized search feature for all the FileMaker blogs found along the right side panel. It is quite handy!


Friday
Aug222014

Purchase Order Number Is Not A Key Field

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

I have done this a number of times in the past but thought I would take a moment to document it here. I’ve designed dozens of purchase order modules for FileMaker users of the years. One thing that commonly identifies a purchase order is the purchase order number. This number needs to be unique to each order, just like an invoice number is unique to an invoice. The aspect that it has to be unique for each record makes it an attractive option for making the purchase order number field my primary key field.


Thing is, some customers want the purchase order to convey some sort of information about the order itself. So the coding of the purchase order number might include a date value, a vendor id, the person placing the order, the location the order is going to and what not. Although unlikely, it is possible that we might get some sort of duplicate purchase order number. Also, some customers want to be able to edit the purchase order number and it is their database solution. As their developer, I have to be able to bend to their will but still keep the integrity of the data.

I cannot allow my customers to change key data unless it is to fix a problem (like an import gone horribly awry). Even then, the answer is no, no, no, maybe, no, no and then finally OK.

To allow a custom to noodle with some unique (like a po number), I tend to use an “under the hood” incremental field as my primary key field and don’t use the purchase order number in any relationship setup. The same rule would follow for invoice number, production job number, requisition numbers and the like.
=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Thursday
Aug212014

The FileMaker ScriptNames Function

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

ScriptNames( fileName)
All Current Versions Of FileMaker
Returns A Text Result

The ScriptNames function gives you the name of each defined script in a particular file. Each script name is listed individually in a text result that is separated by a carriage return between values. This function has 1 defined parameter, which is ... what database do you want to get the list of scripts names for?

Example: ScriptNames ( "Client.FP7") in one of my databases returns...

CREATE_New
FIND_Clients
FIND_Prospects
CONVERT_Prospect_To_Client

FYI... for you FileMaker 9 and higher users ... the names of script groups is NOT returned by this function

Although this function will generally be utilized by those with full developer access, the names of scripts that a privilege set is not allowed to view will not be returned by this function for those users.

More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2010 - Dwayne Wright - dwaynewright.com

Thursday
Aug212014

The FileMaker Field Access Setting Explored

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

The Field Access Setting is part of the Record custom record privilege dialog box setting. Most of the FileMaker security settings are applied to the file, the table, the layout or the record. The field access setting allows you to apply a security setting all the way down to a particular field. Field Access settings will take precedence over the higher level settings that grant access. So a user can have access to a file, a table and a layout but you can set it up that they cannot view or modify data within a particular field. Now if the user does not have access to a file, a table or a layout, the field access setting under those conditions isn’t relevant.

Here you can see the custom record privileges dialog box and the setting for field access, currently this is set at none.

Here you can see the custom record privileges dialog box and the setting for field access. Here you can see the options for the Field Access menu for all, limited or none.

Down another level, you can see that you can choose field access to all fields and none of the fields for a table. The other setting, the limited setting allows you even more power and flexibility.

Choosing the limited setting, brings up this dialog box for access to modify the data in the field, only see the data or no access at all.

Wednesday
Aug202014

How Infinite Loops Happen In FileMaker Scripting

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

Scripts with loops are one of the main ways to have FileMaker perform tedious tasks on a set of records. When a script enters into a loop routine and there isn’t any programmed option in which the script can exit the loop.

So how does a script with an infinite loop happen? What does a script with an infinite loop look like?

GO TO NEXT RECORD LOOPS
A very common script loop is the one that goes from one record to the next in the found set, performing an action on each record it comes across. In a case like this, the last record in the found set needs a flag to exit the loop. If it doesn’t, the script will loop continually on the last record, performing the same action on that record again and again. In a case such as this, the normal flag to exit a loop comes from the script step of Go To Record [Next] in which an option of “Exit After Last” needs to be checked.

Here you can see a script with an infinite loop and one without.

I AM COUNTING ON YOU LOOPS
Another typical loop script is to have FileMaker perform an internal count and then exit the loop when the count hits a determined level. For example, you can have an Exit Loop If step activate when the counter reaches a predetermined number.

Here you can see a snapshot from an example file and the script is uses. Here a user manually enters the number of loops to perform and the script exits when its count equals that value.

I AM DETECTING THAT IT IS TIME TO STOP LOOPING
The Get family of function capture what is going on in FileMaker or in the computer system running FileMaker at a particular point in time. This information can be used anywhere that you might encounter the calculation dialog box. They can be critical in the use in Exit Loop script step because they can be used in a calculation to detect when it is time to quit.

This isn’t how you would do it in the “real world” but you can see that this exit script would work. It uses Get functions to detect how many records are in the found set and what the current record is. When these two values are equal, the script knows that it is time to exit the loop.
=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.

Monday
Aug182014

How Security Settings Can Break FileMaker Scripts

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

This is not as uncommon as you may think. What happens is that security protection is considered as an afterthought by the developer and/or project manager. So a developer starts to put in their security settings sometime before going LIVE with their FileMaker solution or shortly there after. They start to get reports from users that say that this button no longer works. Many times, the developer assumes the user must be doing something wrong. That script worked fine and hasn’t been touched it in ages.

What has happened, is that you didn’t test the script when signed in at a particular security level. One of the settings in the security level is breaking your script. I do not know of any script or security debugger that will catch this for you. I wish I could lay out all the possibilities for you but I cannot. I will give you the two biggest ones that I've come across.

Ability To Edit A Record Turned Off
This will break scripts with the steps of Paste, Insert, Set and Replace for all field types except for global fields. Generally, you will get no blinking lights or warning sirens when the script is running. For script steps that use Paste or Replace, FileMaker will simply pass over the steps it cannot perform and you will be none the wiser. If you are pasting / inserting a calculated result or using the SET script step, FileMaker will generally give you an error dialog box of “Your password does not enable you to do this, or this file is not modifiable.” Of course, if your script has Set Error Capture On, you will not even get this dialog box. In fact, you may end up capturing the wrong error code.

Ability To Export Records Turned Off
This will break script steps that import from one file or table to the next. If you do not have the ability to export records, another FileMaker file will not be able to import that data into it. This will also break the script step of Copy All Records. This can be very troublesome if you are copy a set of records to use in a report or email message.

Most of the above content was written when FileMaker 6 was the latest release. Although the situations are still relevant, those of us using a newer version of FileMaker have an advantage in the above situations. This is a small checkbox in the script to run with full access privileges. So if you click this check box, the script will run as if the user had no data or layout related restrictions and then go back to the users actual security settings when the script is completed.

=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2008 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.