How To Use To Do Fields

As described under Executing A Script When A To Do Entry Is Selected, you can set up the system to automatically launch a script when a user selects a To Do entry. These types of scripts invariably need to access data that resides on the selected To Do entry. The following points describe the type of information that resides on To Do entries:

You can access this information in the following types of steps:

A To Do entry's sort key values are accessed by using a Field Type of Current To Do Information and a Field Name of SORTKEY[index]. Note, you can find an entry's potential sort keys by displaying the entry's To Do type and navigating to the Sort Keys tab. If you want to reference the first sort key, use an index value of 1. If you want to use the second sort key, use an index value of 2 (and so on).

A To Do entry's drill key values are accessed by using a Field Type of Current To Do Information and a Field Name of DRILLKEY[index]. Note, you can find an entry's potential drill keys by displaying the entry's To Do type and navigating to the Drill Keys tab. If you want to use the first drill key, use an index value of 1. If you want to use the second drill key, use an index value of 2 (and so on).

A To Do entry's message parameters are accessed by using a Field Type of Current To Do Information and a Field Value of MSGPARM[index]. Note, because a To Do type can have an unlimited number of messages and each message can have different parameters, finding an entry's message parameters requires some digging. The easiest way to determine these values is to display the To Do entry on To Do maintenance. On this page, you will find the entry's message category/number adjacent to the description. Once you know these values, display the message category/number on Message Maintenance. You'll find the message typically contains one or more %n notations (one for each message parameter). For example, the message text The %1 non-cash deposit for %2 expires on %3 has three message parameters. You then need to deduce what each of the message parameters are. You do this by comparing the message on the To Do entry with the base message (it should be fairly intuitive as to what each message parameter is). If we continue using our example, %1 is the non-cash deposit type, %2 is the account name, and %3 is the expiration date. You can access these in your scripts by using appropriate index value in MSGPARM[index].

A To Do entry's unique ID is accessed by using a Field Type of Current To Do Information and a Field Value of TD_ENTRY_ID.

In addition, any of the above fields can be substituted into a text string or prompt. Simply prefix the To Do field name with a % as you would fields in temporary storage. For example, assume you want your script to display the following text in the script area: "ABC Supply does not have a bill cycle" (where ABC Supply is the account's name). If the first sort key linked to the To Do entry contains the account's name, you'd enter a text string of %SORTKEY[1] does not have a bill cycle.