Database Reference
In-Depth Information
This time you want to work with Timeslips records, so you need to go to the
Timeslips layout.
4. Double-click the next step : Enter Find Mode . Double-click the find request in the
list .
The Edit Find Request window opens.
5. Click the find request in the list. Change its criterion to search the Timeslips::
Line Item ID field .
You're changing the find request so that it searches for empty Line Item IDs in the
Timeslips table instead of in Expenses. The line in the criteria list changes to show
Timeslips::Line Item ID instead of Expenses::Line Item ID.
6. Click Change, click OK and then OK again .
These two clicks close the Edit Find Request and Specify Find Requests windows, re-
spectively. You're back in the script.
7. Double-click the next Set Field step and then change the targeted field to
Timeslips::JobID instead of Expenses::Job ID .
Your Calculated result is just fine and so are the Set Error Capture and Perform
Find steps, so you skip ahead to the last step.
8. Select the second Set Variable step (the last non-comment step), and click the
Specify button. Change the value calculation to read: $unbilledItems +
Get(FoundCount) . Then click OK twice to return to the Edit Script dialog box .
You don't want to replace the value in the script variable; you want to add the found
count of timeslips to the existing found count of expenses.
9. Remove the “TODO:” from the timeslips comment .
When you start writing complex scripts, more comments are better. As you get more
experience, you may prefer to have fewer comments.
10. After the last comment, add a Go to Layout step and set it to go to the original
layout .
Once the script is done finding things, it needs to return to the layout it started on so
the script that ran this one won't be surprised by a layout change. It's usually best
when a subscript puts things back the way they were when it started.
11. Add an Exit Script step at the end of the script. Click the Specify button and
then type $unbilledItems in the calculation box. Save and then close the script .
Search WWH ::




Custom Search