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
Feb172011

Page Up / Page Down FileMaker Portal Rows

From Dwayne Wright PMP
Certified FileMaker Developer

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

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit. For the best experience, please visit the journal directly by clicking (here). 

This example is a modified version of our "Go To Particular Portal Row" example. Here we have added a small modification to the Go To Row Number button and have added the ability to page up and down a portal row.


The modification to the Go To Row Number is that we removed the value list. Now the user can type into a field and enter in any valid number and go to the portal row.

The Page Up / Page down feature is a little more complex but not that bad really. In our example, we added 3 fields ... a global number and two calculation fields with a number result. The calculation field count a value of the next portal row based upon the captured portal row and the number of rows shown.

The way it works is a script sets the Current Portal Row Global field equal to the current portal row using the Status(CurrentPortalRow) function. Then we use the following calculations to decide which portal row we want to go to with the script steps of Go To Portal Row [ By field ] using the page up calculation in the page up script and the page down calculation in the page down script. The calculations are as follows...

PAGE UP CALCULATION
Case(
(Current Portal Row Global - 9) < 1, 1,
Current Portal Row Global - 9)

which simply says give us a portal row number 9 less than the current one. If that total is less than 1 ( which would be the case for rows 1 - 8 ), then go return the portal row number 1.

PAGE DOWN CALCULATION
Case(
(Current Portal Row Global + 9) > Count(self_universal::Universal_Link), Count(self_universal::Universal_Link),
Current Portal Row Global + 9)

which simply says give us a portal row number 9 more than the current one. If that total is greater than the total number of rows ( we use the aggregate count function to determine this ), then go return the number of the last number in the portal.

An example file can be downloaded by clicking (here)

FYI ... UNFAMILIAR WITH SELF RELATIONSHIPS?
A Self Relationship is a common term for a situation in which both sides of the FileMaker relationship are the same table. It is even possible that the matching key fields are the same field. This can be handy when using the Go To Related script step or when using Aggregate Functions.

Self relationships can be one to many, many to many or even the filtered varieties.

Here you can see a self relationship I use in the FileMaker database I use to contain all my blog related data. In this case, I have my blog related to itself using the same field of blog. This way I can be writing a blog for my Security blog and quickly see all the previous security related blog posts in a portal by its side.

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
Feb172011

Navigate FileMaker Portal Rows Via Crafted Buttons

From Dwayne Wright PMP
Certified FileMaker Developer

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

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit. For the best experience, please visit the journal directly by clicking (here). 

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.

FIRST, PREVIOUS, NEXT and LAST
On our layout, we have 5 buttons which are First, Previous, Next and Last. These will allow users to navigate portal rows and can come in handy if your audience is new to FileMaker. For example purposes, 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. These four buttons are not even attached to a script but are wired to button action choices. You could certainly script this action and you might want to if you wanted to run some other operation piggy backed to the portal row navigation action.

PORTAL ROW VIA AN ENTERED NUMBER
We also added a button to go to a portal row by an entered number. In this case, we did attach this button to a script  and all you need to do is choose a portal row number from the radion button value list above the button and then click the button.

This is a somewhat lame example of the "Go To Portal Row By Number" feature. Generally this is used in more sophisticated batching operations that may involve many records. The ability to go to a portal row via a calculated value opens up plenty of options for the creative programmer that stumbles upon unique needs.

A MODEST TWEAK TO THE SCRIPT
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

An example file can be downloaded by clicking (here)
=
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.

Sunday
Feb062011

Reporting In A New FileMaker Window

From Dwayne Wright PMP
Certified FileMaker Developer

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

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit. For the best experience, please visit the journal directly by clicking (here). 

This is a fairly simple report that comes up in the new window. We only have two data fields which include an invoice date and an invoice amount. What we want to do is show a report that summarizes the invoice sales for each year and then further broken down by the month of the year. The report will run on the found set of records. So you can do a find for a particular set of records and then run the report.


There are two sorted by subsummary layout parts the sort fields uses are both calculation fields. The first is year of the sale and the second is the month of the sale. There is a script that runs the report in a new window and a subscript that handles the report printout actions.

Clicking the Run Report button will activate the report. You might want to have the script debugger running if you have FileMaker Advanced installed on your machine. That will allow you to see the individual script steps execute one at a time from the script debugger window.

An example file can be downloaded by clicking (here)
=
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.

Saturday
Jan292011

FileMaker Filtered Portals With GetField

From Dwayne Wright PMP
Certified FileMaker Developer

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

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit. For the best experience, please visit the journal directly by clicking (here). 

FileMaker 11 has a new feature that allows for filtered portal options from the portal setup dialog box. Opinions about this new feature have been mixed and vary wildly. I've heard comments that range from "not completely thought out" to "the best new feature in FileMaker 11".

However, there have been techniques to filter portals ever since portals first came out (FileMaker 3.0 BTW). One of my favorites involves the use of the GetField function because it makes the process easy, clean and robust.

THE GETFIELD FUNCTION EXPLORED
The GetField function can return at least two different results based upon if you include quotation marks in the syntax of the field name. If you use quotation marks, you get the information inside of the field. If you don’t use quotation marks, it looks at what is inside of that field. If the data inside the field you reference within the GetField parameter is equal to the name of another field, it returns the contents of that field for that record.

HOW ABOUT AN EXAMPLE?
Say that we have a FileMaker table that has information about a number of people. The functionality we want to present is the ability to see other records that match the record we are on. So the matching recods are show in a portal on the layout and we want the user to have the ability to filter what they consider a match. For example they only want to see matching cities, matching states or matching phone area codes. I created a short quicktime movie to illustrate the concept and you can view/download it by clicking (here).

GOING UNDER THE HOOD
To filter our portal, we will want to create a global field and save it as a text result. It will need to be a value list with the 3 options we want. These options will also be the names of the fields in our table and will be using as our child keys. As you might have imagined, these value list selection options will be City, State and Area Code.


In the “PARENT MATCH FIELD: GetField(Portal Filter)” calculation, we create a field called Parent Match Field and we are using the GetField function to get our global filter field ( which we call portal filter ). So if we choose City, the contents of the City field will be in the Parent Match Field field. Using the GetField function without the quotation marks will return us the value within the field we are choosing. So if the Portal Filter field has be value City within it, the function will return the value of the City field for the current record we are on.



Here is a sneak peek at the calculations in out parent and child match fields. 

You can experiment with the quotation marks inside of the GetField function as well to see how the results change. Just make sure the quotes are off when you save the file or the example will be broken.

In the “CHILD MATCH FIELD: State & "¶" & City & "¶" & Area Code
“ calculation, we are putting in all the possible matches for a particular field and separating them by a carriage return. This is what we call a multiple key field.

BTW: THIS EXAMPLE USES A SELF RELATIONSHIP
A Self Relationship is a common term for a situation in which both sides of the FileMaker relationship are the same table. It is even possible that the matching key fields are the same field. This can be handy when using the Go To Related script step or when using Aggregate Functions. Self relationships can be one to many, many to many or even the filtered varieties. In this example, we want to see similar contacts, so a self relationship is the best way to go.


I added a tab to the example file so that you can play with the settings of the Portal Filter field and watch the Parent Match Field update itself.

There are a few things we want to recommend, if you choose to use this example in your FileMaker file. The state should be validated to be a 2 character text field. There is at least one city that has the same name as a state ( New York ) and that could goof you up ... if you don’t use 2 character state abbreviations.

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.



Sunday
Jan232011

FileMaker Password Generation

From Dwayne Wright PMP
Certified FileMaker Developer

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

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit. For the best experience, please visit the journal directly by clicking (here). 

I don’t do this anymore because FileMaker security and the hacking of passwords is much more of a threat these days. Anyway, I just wanted to throw this out there as an example of a unique approach I used to use in generating passwords.

There was a time (back in the day) that I had to create rotating passwords for a pre-FileMaker 7 solution. So that I didn’t have to spend a lot of time thinking up passwords, I would grab one of my many music CDs when setting password levels. I would use the first word of each song as a password. This made it quick and easy to make very unique password schemes. It also allowed me to associate a solutions password scheme to a CD.

For instance in the above solution, I'll use Anchorless by Kacy Crowley (which I recommend highly). It looks something like this...

User 1 = hand
User 2 = rebellious
User 3 = bottlecap
User 4 = singers
User 5 = melancholy
User 6 = vertigo
User 7 = anything
User 8 = nickel
User 9 = follow
User 10 = scars
User 11 = love

Of course, sometimes you can predict some of the passwords of some designers based on the music they enjoy. Some will have love, devotion, hope and charity while others may have drunk, penniless, abandoned and tequila. I’m joking! Anyway...

You could still use this technique but I would recommend tweaking it a bit to have a variation of case and numbers. So perhaps something like this would be more secure and harder to guess.

User 1 = hand01
User 2 = rebell10us02
User 3 = b0ttlecap03
User 4 = s1ngers04
User 5 = melanch0ly05
User 6 = vert1g006
User 7 = anyth1ng07
User 8 = n1ckel08
User 9 = f0ll0w09
User 10 = scars10
User 11 = l0ve11

Now all I did was change where the letter O appears and replace it with a zero, replace the letter i with a 1 and add an incremental number on the end. Again, something that could possibly be guessed but much harder and it is not that hard to remember. I didn’t add any upper / lower case but you can see the idea.

There are a number of other great techniques out there for creating passwords that are reasonable to remember but hard to guess.
=
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.