Database Reference
In-Depth Information
Now the script can find and count unbilled activities for the current job and then perform a
test on the count so it can decide whether to create an invoice or tell the user that no invoice
is necessary ( Figure 17-26 ).
Figure 17-26. The main script now has one completed subscript with a script parameter. It tests the
subscript's results and branches based on the value it finds. The remaining TODO comments and
Perform Script [<unknown>] steps give you a perfect roadmap of the work ahead.
Finishing the Create Invoice Record Subscript
The Create Invoice Record script needs to switch to the Invoices layout, create a new record,
attach it to the job (by filling in its Job ID field), grab the new Invoice's ID and then switch
back to the original layout. And like the last subscript, this one needs the Job ID in its script
parameter when you hook it up.
Since you're used to removing the “TODO:” part of your existing comments and placing the
appropriate script steps just below them, the remaining tutorials in this chapter will skip
those instructions for simplicity's sake. Now you're ready to polish off the Create Invoice
Record script itself:
1. Double-click the Create Invoice Record script in the Manage Scripts window to
edit it .
The Edit Script window opens. You'll replace your TODO comments with real script
steps now.
2. Add the Go to Layout script step at the top of the script. Set the step to go to the
Invoices layout .
Search WWH ::




Custom Search