Database Reference
In-Depth Information
Finishing the Subscripts
You've created a series of subscripts that have placeholder comments to remind you what
process the script will perform. Now it's time to finish each subscript and turn them into
working scripts by replacing those comments with real script steps.
The Find Unbilled Activity Subscript
Before you leap into finishing this script, a short refresher about what you're trying to ac-
complish is in order. The Find Unbilled Activity subscript is the first step in the “Create In-
voice for Job” master script, which runs when a user clicks a button on the Job layout. You'll
use a script parameter to send a
Job ID
to the subscript, so it can find the right items. As the
name says, it finds unbilled activity by searching the Timeslips and Expenses tables for items
related to this job.
The first TODO item inside the script is a cinch: Just use the
Go to Layout
script step to
switch to the appropriate layout. Next, for the current job, you need to find expenses that
don't have a line item ID. You'll use a combination of
Enter Find [Restore]
,
Set Field
with the Job ID
(from your script's parameter), and
Perform Find
to make sure you
don't get items that have already been billed. Then, the script will count the found items so it
can send that value back to the main script. Finally, you'll do the same thing for the
Timeslips table.
1.
In the Manage Scripts window, double-click the Find Unbilled Activity script to
edit it. Add the
Go to Layout
script step to the script
.
If necessary, drag the
Go to Layout
step just below your first comment. Remember,
if a script step is selected, any new step you create lands just below it.
2.
In the
Go to Layout
Script Step Options area's Specify pop-up menu, click the
layout pop-up menu and then choose Layout to show the Specify Layout window.
Choose Expenses and then click OK
.
As always, context is one of the most important concepts in getting a process right.
3.
Add an
Enter Find Mode
script step after the
Go to Layout
step. Turn off the
Pause checkbox and then turn on the “Specify find requests” option
.
The
Enter Find Mode
script step appears in the step list and then the Specify Find
Requests dialog box opens.
4.
If any requests are showing in the list, click Delete until they're all gone. Click
the New button
.
The Edit Find Request window appears.