Working with Scripts Flashcards
What are the implications of using the Set Error Capture [On] script step?
The Set Error Capture [On] script step suppresses any error dialogs from being shown to the user and allows the script to keep running. This could result in accidentally altering data in some unexpected way.
A custom app contains a script, shown below, that is supposed to find a set of People records using City as a criteria. Users report a problem. They expect to see a dialog that says “There are no records for that criteria.” when entering a city that does not exist in the system, but instead they are left with a blank screen. Explain what the problem is and how it should be fixed. - the image is in section 5 of the filmmaker pro 18 study guide
The Get (LastError) function returns the error of the immediately preceding step. In the script above, this function is called after the Sort Records step, so it returns any error of that step, not from the Find Records step. To fix this problem, the developer could move the Sort Records script step to after the Get(LastError) check.
In a custom app containing people and contact methods, there is a script that deletes all the related contact methods for an individual person record. The script, shown below, is triggered by a button on a layout linked to the People table occurrence.
Describe what will happen if this script is run on a People record with no related contact method records
- the image is in section 5 of the filmmaker pro 18 study guide
If this script is run on a person record with no related contact methods records, line 14 will fail and the layout context will not change. Line 16 will then delete all the records in the found set in the People table. Finally, line 18 will close the window the user was on.
A file contains a script for updating product records with current sales information. A user needs to run this script, but her privilege set doesn’t allow her to edit any product records. How could this script be set up to allow her to perform this action?
This script can be given the ability to run with full access privileges. This can be set by right-clicking on a script name and choosing “Grant Full Access Privileges” or by choosing that option in the Scripts menu.
Script A sets the variable $ID to the primary key of the current record. Then it calls Script B as a subscript. What are some options for getting the value of $ID into Script B?
Variables with a single $ are local to that script only. There are several ways Script B could have access to the data.
a. Pass the variable into Script B as a script parameter and use the Get(ScriptParameter) function to retrieve that value.
b. Change the local variable ($ID) to a global variable ($$ID) and reference this variable in the subscript.
c. Set a field with global storage with this value and use that field’s value in the subscript.
A script contains a New Window script step set up as follows: - the image is in section 5 of the filmmaker pro 18 study guide
What should the layout include to ensure the user is not stuck on the card window when calling this script in FileMaker Pro Advanced? How is this different than in FileMaker Go?
Since the option to close the window is not checked in the options, it is vital to have a button that will close the window by a script. Card windows are modal to their parent window in FileMaker Pro Advanced. In FileMaker Go, a card window can be closed by tapping into the gray area of the background window. If you do not select the Close option, users have no way to close the card unless you include a script (for example, assigned to a button in the Card) that performs the Close Window script step.
Can you choose the location of a PDF to be saved when using the script step Save Records as PDF in FileMaker WebDirect?
No. FileMaker WebDirect downloads the PDF to the browser’s default download folder.
You need to write a script that deletes all records from a table called “Temp_Invoices.” Related records from a related table called “Temp_InvoiceLineItems” should also to be deleted, and the relationship is
set up to cascade delete the invoice line items records. To ensure all Temp_Invoice records and related Temp_InvoiceLineItems records are deleted, which script step should be used: Truncate Table or Delete All Records.
The Truncate Table script step will delete all the records of the current table, but will not delete child records
even if the relationship is set up to do cascading deletes. The Delete All Records script will delete all records in the current found set and trigger any cascading deletes.
What version of the ODBC driver should be used when running a FileMaker Server scheduled script that includes the Import Records using an ODBC data source?
FileMaker Server scheduled scripts require the 64-bit version of the ODBC driver to be installed on the server machine.
For FileMaker WebDirect, how do you set the options for the Save Records as PDF script step?
The options for the Save Records as PDF script step are not supported in a script for FileMaker WebDirect. Instead, the Print Setup script step will set these options.
What can you do with the Create Data File, Open Data File, and Write to Data File script steps?
Create custom log files or export data in a custom format.