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!


Thursday
Jun042015

The Format Of FileMaker Calculation

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

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

In the FileMaker calculation dialog box, most users will have a point and shoot design mentality. It goes something like this...

- there is that thing I want to add to my calculation
- I have selected that thing by clicking once upon it (point)
- I double click that thing to add it in my calculation dialog box (shoot)
- I see my selection appear in the text area as text
- I edit the text string as need, perhaps even by pointing and shooting other things.

Very few of you, simply type what you need into the dialog box, because you are familiar with the syntax of the calculation you want to use. This reduces the time to enter a calculation and is a much easier transition to calculation documentation. Hugh, what documentation? You can type text into a calculation work area that is for comments only. You just have to proceed or end that string of text with a flag. Anyway, when you type in your calculation without using any of FileMaker’s helper buttons/menus, you can quickly type in comments to refer to later (if/when) you or another developer has to edit that calculation.

Anyway .... how about we start talking about calculation formatting?

A calculation in FileMaker has to be formatted correctly to get expected results. It is not that hard to do and it may be second nature to you. The calculation test format is familiar because FileMaker calculation formats are basically the same as regular mathematic formula formats.

To have a successful calculation, you need to determine what result you want to get and in what format (text, number, date, time, timestamp or container). Next you need to enter in the calculation itself and this is normally called the calculation expression.

As a general rule, the calculation expression is read from left to right. So a calculation of 2 + 2 * 4 would be calculated as two plus two and then that result is multiplied by four. So our returned value would be 16. This is because two plus two equals four and four multiplied by four equals sixteen.

Now we need to chat about parenthesized expressions or those calculations that are within a left and right parenthesis. Parenthesized expressions are calculated first and then the calculation goes back to reading from left to right. So a calculation of 2 + (2 * 4) would be calculated with the parenthesized expression first ( 2 * 4) and then that result is added by two. So our returned value would be 10. This is because two multiplied by four equals eight. The we go to the left of the calculation and add two, which of course is 2 + 8.

In following discussions, I will chat about the formatting of FileMaker functions. The format of a calculation can still take a turn when we start discussion operators. Then I will chat still later on ways to format complex calculations with multiple functions, multiple operators and parenthesized expressions to be easily read.

However when it is all said and done, your first and primary control over a calculation is the use of left and right parenthesis around expressions.

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

© 2007 - 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.

Tuesday
May262015

The Go To Layout FileMaker Script Step

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

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

This script step will take you to a layout in the current window / file.

You cannot go to a layout in another window unless to go to that window first. Also, you cannot have a GO TO LAYOUT step for a layout in an outside file. A way around this is to have your script, call an external subscript in another file, which in turn would have the GO TO LAYOUT step.

You also can specify a layout by it’s number in the layout order list. This is done by using a calculated value specified in the options of the Go To Layout script step. If you reorder your layouts however, this script could take you to the wrong layout.

You also can specify a layout by it’s name. This is done by using a calculated value specified in the options of the Go To Layout script step. If you rename your layouts (or don’t use unique layout names however, this script could take you to the wrong layout.

You also have the option to take the user back to the original layout. This is used in a script that has 2 or more Go To Layout script steps in it, to take the user back to the original layout when the script was first called upon.

There are times when you need to take ScriptMaker to a particular layout so that it can perform a set of script steps. For example, to use the GO TO PORTAL ROW script step, the portal needs to be on a layout it can be found on when that step is executed. If not, FileMaker simply passes over that step.

COOL IMPLEMENTATIONS OF IT
One of the most simple but yet very cool implementations I've seen is to go to a developers layout in a script. What you do is create one layout in all files that has all the fields and possible portals you use in the file. Then you always go to this layout when executing complex scripts and then use the Go To Layout (original layout) when you are done without any error notification to the user.

Another very cool implementation is going to layout by a calculation. That means you can react to any calculated result before going to that layout. I have a solution that allows a user to determine if they like to go to form view or list view when they go to a different module (such as going from contacts to invoices). I use the Go To Layout (calculated) to go to the layout that user prefers to end up on!

FYI...
It's not enough to take the user to the correct layout/screen. Always make sure they are in the right mode (Browse - Find - Preview).

Got To Know Factor - 8

Here you can see the options for the Go To Layout script step. You can go to a specific layout, a layout in the layout order as defined by a calculated value, go to a layout name by a calculated value or an original layout ( used when you a previous Go To Layout step and you want to go back to where you started).

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

© 2007 - 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.

Tuesday
May262015

The Basics Of The FileMaker Calculation

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

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

There are 3 main areas of knowledge and experience about FileMaker. These 3 areas involve relationships, scripting and complex calculations using functions. Mastering each of these areas is obviously going to make you a better FileMaker developer. Going beyond the individual knowledge of each of these areas, is the ability to use them in concert. Blending expertise in relationships, calculations and scripts are the advanced criteria to building superior FileMaker database solutions.

Typically we think of a calculation as 1 + 1 = 2. An invoice that totals up line items, tax and shipping charges is another classic calculation and one that you will find within many of a FileMaker solution. These types of calculations are just the tip of the iceberg and a careful study of FileMaker calculations can make your databases take a huge leap forward in productivity and ease of use.

Some calculations within FileMaker come pre-packaged and we call them functions. These functions have dedicated areas were you can plug in the fields from your database, literal text or even another calculation/function. A function will have a name, an argument (within parenthesis) and parameters (which are separated by semicolon characters). I will cover functions in greater detail in other discussions.

Calculations are not limited to calculation fields, in fact calculations take place in many areas of FileMaker design. There is no way I could cover all these in this one topic but let us take a moment to list them for you here.

A calculation can be used

- in calculation fields ( of course )
- to branch a script ( If script step )
- to control script loops ( Exit Loop If script step )
- to place data in a field in a script ( Insert Calculated Result and Set script steps )
- to replace data in a found set ( Replace command and script step )
- to auto enter information in fields when a record is created
- to validate that data entered in a field matches calculated criteria
- to set security privileges for records and fields
- to control relationship comparisons ( via the comparison operator or key fields in the relationship )

and it seems with every new release of FileMaker, calculations can be found in even more areas!
=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2007 - 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.

Friday
May222015

FileMaker Launcher Files With Embedded Account Settings

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

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

Overall, I recommend that each user have an unique account name and password and a developer take the appropriate actions to make that a reality. However, not every situation is the same and here is a technique that you can use if you have multiple users using the same account settings and you have multiple files with single tables.

In fact, I strongly recommend against the technique I'm describing but it is important to know that you may run into this type of setup as a professional FileMaker developer.

The purpose of this technique is to create a FileMaker file with a default security account for one purpose ... to open another file with those security access settings. If one FileMaker file has been opened with the same account/password as another FileMaker file, when needs to open that other file ... it will use the same account/password. This helps keep the account/password challenge entry dialog box from opening up all the time as you navigate to newly open FileMaker files.

How it works...
If the invoice and the inventory files both have the account setup with the name of Sales and has a password of PointyHairBoss ...

If you open the invoice file with the account/password of Sales/PointyHairBoss...

If there is a portal to the inventory file, it will need to open the inventory file...

It will open the inventory file with account/password of Sales/PointyHairBoss automatically and the account/password entry dialog box will not come up.

FYI... As with any default password system, many developers will say that a launcher file is a potential security breach. For example, if the opener file were to get into the wrong hands, it would be a potentially major security breach. So for the above reasons, I would suggest this technique for the lower level security settings and not the higher ones.
=
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.

Friday
May222015

The FileMaker DatabaseNames Function

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

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

DatabaseNames
There is no parameter for this function
All Recent Versions Of FileMaker
Returns A Text Result

The DatabaseNames function provides the names of all open FileMaker database files at the time the function is executed. Each database file name is separated by a carriage return. If you are thinking about using this in script branching, you will probably have to use it in tandem with the PatternCount function.

The extension information is not included in the result of the function. This means that it is possible ( however remote ) that this function might break if you have two FileMaker databases open with the same name but different extensions. This could be the case when you are building runtime databases with FileMaker Advanced.

© 2010 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. FileMaker Pro is the registered trademark of FileMaker Inc.