Database Reference
In-Depth Information
▪ TODO: Check to see if there are unprocessed timeslip records.
▪ TODO: Make an Invoice Line Item record related to the new invoice.
▪ TODO: Loop through found records to gather total billable hours.
▪ TODO: Set the total in the new Invoices Line Item record.
Here are the comments for the Process Expenses subscript:
▪ TODO: Check to see if there are unprocessed expense records.
▪ TODO: Loop through found expense records.
▪ TODO: Make an Invoice Line Item record for each expense record.
Even though they're very similar, you'll write the Process Timeslips and Process Expenses
script from start to finish. But as you get more scripting experience, you may find that it
makes sense to write one script, test it thoroughly and then when you're sure it's perfect, du-
plicate the script and edit the steps appropriately for the second process.
To recap: In this section, you just created all four Perform Script steps in the “Create In-
voice for Job” script and then you made four skeleton subscripts. In the real world, you could
create each Perform Script step and then start writing the subscript while you're thinking
about that specific process. You could even start with the last subscript and work your way
backward, if that made sense to you. The order in which you tackle the individual steps isn't
as important as finding a method that keeps you from forgetting part of a process or getting
steps out of sequence.
It's also common to start out intending to write one long script and then as it grows, realize
that you've got a set of steps that deserves its own subscript. Select and copy the steps for the
process (Cut doesn't work in the Edit Script dialog box, unfortunately), create a new script
and then paste them into the subscript. Give the subscript a descriptive name and then save it.
Back in the parent script, delete the steps you moved to the new subscript and then add a
Perform Script step to call it.
NOTE
Now that all your skeleton subscripts are finished, you could go back to the main script and change
each empty Perform Script step to specify its proper subscript. But if you hook up each subscript
as you finish it, the main script serves as a To Do list. You can tell at a glance which scripts you've
done and which ones still need attention.
Search WWH ::




Custom Search