Learn about best practices, common mistakes, and how to build your system with best practices. Why to avoid indirection and how to use tools to identify indirection. Learn techniques that you can easily implement to ensure your system is dynamic and built to last.
Learn the following:
• The benefits of a dynamic system
• Bad scripting, functions to avoid
• Identifying Indirection With BaseElements
• Using FileMaker Internal IDs
• Execute SQL, friend or foe?
• Additional resources
2. Questions
If you have a question, please
typist it into the console. If we
don’t get to your question, please
send it to fba@dbservices.com
3. Agenda
• The benefits of a dynamic system
• Bad scripting, functions to avoid
• Identifying Indirection With BaseElements
• Using FileMaker Internal IDs
• Execute SQL, friend or foe?
• Additional resources
4. About DB Services
•We are a team of analysts, developers, and
designers creating custom applications to make
your organization more effective and efficient.
Learn more about our FileMaker services on our
website.
•If you leave this presentation wanting learn more!
Check out our FileMaker Blog where we post new
content each month.
•To learn more about DB Services, check out our
website at www.dbservices.com
5. Background
Work
• Member of FM Academy
• Article included in FM Newsletter
• Global presence (Canada, Europe,
Africa)
• Team focused on adding value
• Senior Application Developer at
DB Services
• Certified in 15, 14, 13 , 12
• Working with FileMaker for 10 years
• Sponsor at FileMaker Developer
Conference
6. Benefits Of A Dynamic System
• Allows renaming of objects
• Allows analysis tools such as BaseElements
to identify objects in use/unreferenced
• Prevent errors
7. Indirection
Any development practice that prevents FileMaker to
recognize your usage as a reference to the object.
These will not show up as being used in a DDR
Good Indirection - Dynamically grabbing an object name
and using it in your solution.
8. Things To Avoid
Hardcoding
• Table occurrence names
• Layout names
• Field names
• Window Names
• Value List Names
• Script Names
*Layout Object Names
• Never rename a layout object
10. Scripts/Functions
• Set Field By Name
• Go To Layout - by name or #
• Go to Related Record - Layout by name or #
• Select Window - File Renaming
• Close Window - File Renaming
11. Common Examples
If [ Get ( LayoutName ) = "Orders" ]
Do Some Code
End If
Evaluate( “TableName” & “::” & $fieldName )
ExecuteSQL ( “SELECT companyName FROM customer” ; “” ; “” )
ValueListItems( Get( FileName); "DealerAllProducts")
12. Examples
Set Variable [ $GeoField;
Value:
Case( not IsEmpty( GLOB_Globals.tog::gFedExZone) ;
"ord_ZIPzone::FedExRateZone";
not IsEmpty( GLOB_Globals.tog::gState) ;
“ORD__Orders.tog::OrdShipState_t”;
not IsEmpty( GLOB_Globals.tog::gCountry) ;
“ORD__Orders.tog::OrdShipCountry_t”; "") ]
Set Field By Name [ Evaluate ("$ProdSpecField"); $ProdSpec ]
13. Examples
Set Variable [ $GeoField;
Value:
Case( not IsEmpty( GLOB_Globals.tog::gFedExZone) ;
getfieldname( ord_ZIPzone::FedExRateZone );
not IsEmpty( GLOB_Globals.tog::gState) ;
getfieldname( ORD__Orders.tog::OrdShipState_t );
not IsEmpty( GLOB_Globals.tog::gCountry) ;
getfieldname( ORD__Orders.tog::OrdShipCountry_t ); "") ]
Set Field By Name [ $GeoField; $ProdSpec ]
18. FileMaker Internal IDs
Using custom functions to identify the internal
id in FileMaker.
Pros
• Allows you to rename objects
Cons
• Still can not be seen by DDR/BaseElements
• Harder to read code
19. FileMaker Internal IDs
Can all be referenced using internal ids
• Tables
• Layouts
• Value Lists
• Fields - GetFieldName( )
• Scripts
21. Execute SQL
Pros
• Context Independent
• Can save time when development
Cons
• Natively requires indirection
• SELECT only
• Large sets of data can have performance issues