VISUAL QUICKPRO GUIDE FileMaker Pro 7 Advanced FOR WINDOWS AND MACINTOSH [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

VISUAL QUICKPRO GUIDE FileMaker Pro 7 Advanced FOR WINDOWS AND MACINTOSH [Electronic resources] - نسخه متنی

Cynthia L. Baron, Daniel Peck

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید











Controlling Scripts with User Input


You can use the Show Custom Dialog script step to prompt a user entry to control a script. The message text you enter will be displayed in a dialog box.

Using the Print Invoices script, we can add a step that checks whether there is an Invoice Date and, if there is, asks you if you want to print the invoice anyway. This will prevent unintentional duplicate invoices. You can include If steps within other If steps (nested Ifs). Just as steps in an If are run only when the preceding If is true, a nested If is evaluated only when the first If is true.

If the user chooses the Print button, the script will execute the rest of the steps. If the user chooses Don't Print, the script will stop.

To control scripts with user input



1 .

Choose Scripts > ScriptMaker (Control+Shift+S/Command+Shift+S). When the Define Scripts dialog box appears, click New.

2 .

In the Define Scripts dialog box, click the script to which you want to add user controls. In our case, it's the Print Invoices script. Click the Duplicate button, then click Edit. This keeps your original script intact, which can be very useful if you make a mistake as you edit.

3 .When the Edit Script dialog box appears, give the script a slightly different name. Click the second Set Field step in the script-assembly list.

4 .

In the step window on the left, click Else (Figure 8.45).

Figure 8.45. Select the step before the one you want to insert.


[View full size image]

5 .

Scroll down to the Miscellaneous category in the script step list on the left and double-click Show Custom Dialog (Figure 8.46).

Figure 8.46. Show Custom Dialog is used to display text and get input from the user.


6 .

In the Script Step Options section, click Specify. The "Show Custom Dialog" Options dialog box opens (Figure 8.47).

Figure 8.47. You can enter text to create a customized message and set of buttons. OK and Cancel are the default choices, but you can replace them with custom text.


[View full size image]

This dialog box will generate a customized message and buttons in your operating system's standard format. The dialog box can have up to three labeled buttons.

7 .If you want to add a title for the Custom Dialog window, type it in the Title box. We use Double Check.

8 .In the Message text box, type:

This record looks like it's already been invoiced. Do you want to print another copy?

9 .In the Default Button text box, type Print. Type Don't Print in the Button 2 box (Figure 8.48). Click OK.

Figure 8.48. Designate your message choices in the "Show Custom Dialog" Options dialog box.


When you run the script, these choices will generate your custom message (Figure 8.49).

Figure 8.49. This custom dialog box will display when you run the script.


10 .In the step list on the left, double- click If.

11 .In the Script Step Options section, click Specify.

12 .When the Specify Calculation dialog box appears, click the View drop-down menu and scroll down to "Get functions." Click to select it and display the detailed Get functions list. Double-click Get(LastMessageChoice). Click to the right of it in the formula box and type =2 (Figure 8.50). Click OK.

Figure 8.50. If the user clicks the second button, Get(LastMessageChoice) will equal 2.


13 .

In the step list on the left, double-click Exit Script (Figure 8.51).

Figure 8.51. The "2" in this step refers to the second button choice in the dialog box.


This If step looks at which button was clicked. If the second ( Don't Print) button was clicked, the script ends without printing anything.

14 .Click OK twice to finish.

When you run this script, FileMaker will look for an Invoice Date and print an invoice if it doesn't find one. If there is an Invoice Date, the alert message will ask if you want to print a second one anyway.



/ 227