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!


Tuesday
Nov102015

Navigate Portal Rows Via Buttons

From Dwayne Wright PMP - Certified FileMaker Developer
WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

In this example, we show a very easy technique of moving from one portal row to the next via buttons. On the surface this seems to be a very trivial example but it does show that you can control FileMaker's ability to navigate portal rows. This can become very helpful as you start to build larger and more complex scripts and interfaces.

In the example we have 5 buttons which are First, Previous, Next, Last and Go To Row Number. We show a portal listing the seasons of the year which are Spring, Summer, Fall, Winter and Football. The last is my favorite, I must say.

The first four buttons are not even attached to a script. You can define a button go to these portal rows directly via the button choices. Originally, this example used the go to portal row by field. During conversion to FileMaker 9, this was automatically updated to Go To Row By Calculation. Going to a portal row by the contents of a field can be scripted. This is exactly what we did. All you need to do is choose a portal row number from the value list and click the button next to it.

I also added a button called Go To Row Dialog. This will bring up a dialog box allowing you to manually enter in a portal row to go to.

I only added one tweak that is a little off of the beaten path. If the Portal Number field is empty, the script brings up a dialog box asking what portal row you want to go to . The script looks like this ...

If [

IsEmpty(Portal_Number)]
Go To Portal Row [ Select By Number ]

Else
Go To Portal Row [ Select, "Portal Number"]
** which is the name of the field **
End If

The final thing we did was add another layout that uses a similar relationship but it can create new related records on the fly. You can get there by clicking the View Add Related button. From here, you can add a season to the global field and click the add new season button. This goes to the last row in the portal ( empty waiting to create new related records ), sets that field equal to the global, sets the global to empty and exits the record.

An example file can be downloaded by clicking (here)

=
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.

Wednesday
Oct282015

The FileMaker Calculation Field And Storage Options

From Dwayne Wright - www.dwaynewright.com

In many ways, the storage of a calculation is the same as the storage of a regular field. In a regular field, the third tab of the field options settings is for the storage of the field in regards of global storage, repeating fields and indexing.

The global field option is used to contain a single literal value for all records in a FileMaker file. Any field that has data stored globally has one value and it can be viewed no matter where you are in a FileMaker file. By anywhere, I do mean that any global field in any table can be view from any record of any other table. Fields with the global option can be edited directly on a layout or via a script. Global fields work about the same as normal entry fields in that you can click inside them, cut, paste and add new data.

FileMaker indexes focus on the data within a field. So if you have a FileMaker field indexed, FileMaker can look at it and go to the associated records quicker than it can if it is not indexed. For this reason, indexing is a key player in searches, sorts, reports and relationships.

A repeating calculation field is any type of field ( except summary ) with a specific storage option setting. The storage option of repeating fields allows you to have multiple cells of information in the same field. If you have two repeating fields in a calculation, each cell repetition will be calculated by the same cell repetition of the other field. In cases where a repeating field is in a calculation with non-repeating fields, you will need to use the Extend function. In fact, with any calculations involving repeating fields, you may need to refer to some of the functions that are particular to repeating fields. I cover this in other discussions but here is a list of those repeating functions and how they are commonly used.

Extend - Extend( non-repeating)
Used to extend a non repeating field to be used in a calculation for each repetition that needs a calculated result.

EXAMPLE: A repeating field has these three values in each repetition ( 2, 3, 6 ). If we extend a field that has the number 2 in it and multiple it by the repeating field, we would get ( 4, 6, 12 ) as our repeating results. Without the extend field, only the first repetition would be multiplied by 2. So you would get ( 4, 3, 6 ).

GetRepetition - GetRepetition( repeatingField ; number)
This function returns a specific value of a particular repetition of a repeating field. For instance it can tell you the second repetition of the field phone type is fax. The function does have the two parameters of repeatingfield and number. The first is the specified repeating field you want to work with. The second is the particular repetition that you want.

Last - Last( repeatingField)
This function returns the last valid, non empty value in a repeating field or a related field. In a relationship, the last can change based upon the setup of the relationship. By default, the last value would be the value that is in the record that was most recently entered. Sorting a relationship may change this because the last value entered may not be the last record in the sort order.

=
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.

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.