Related Information Examples & Tutorials

Run Plan In Reports And Control Files

Collect!'s Report Writer enables you to execute events when a report is run. You can set up any sequence of actions you need by creating a contact plan. Then, you can call that plan right inside the Report Body. You can also call plans to run from within a control file.

tip.gif This feature is available in Version CV11.4.3.4 and newer.

Use Caution

The @RUNPLAN command is a powerful feature. You are advised to be careful when you use it to run a contact plan, especially if you use it in a report loop! Please test carefully whenever you call a contact plan with this feature.

Top of page.

Runplan Command

The Report Writer command for running a Contact Plan is @RUNPLAN.

SYNTAX:

@RUNPLAN({record},{planID}) {if ( @var = n )}

{record} = Either Client or Debtor
{planID} = Contact plan code
{if conditional} is optional and behaves normally

tip.gif The @RUNPLAN command is NOT case-sensitive.

EXAMPLE 1:

Run Contact Plan REV on the current Client:

@RUNPLAN(Client,REV)

This would run the REV contact plan on the Client who is current when the report or control file is executed.

EXAMPLE 2:

The @RUNPLAN command also works in loops.

Run Contact Plan REV on all Active Debtors:

@de no total where ( @de.mo = Active )
@RUNPLAN(Debtor,REV)
@de

EXAMPLE 3:

The {planID} can also be a variable.

Run @varPlan on current Debtor:

@varPlan* = CLO if ( @de.ow < 1.00 )
@varPlan* = REV if ( @de.ow = 1.01 .. 50.00 )

@RUNPLAN(Debtor,@varPlan)

EXAMPLE 4:

The @RUNPLAN command can also be executed with optional "if" conditions.

Run CLO if the Debtor's Owing is less than $1.00:

@RUNPLAN(Debtor,CLO) if ( @de.ow < 1.00 )

Top of page.

Runplan Troubleshooting

If the @RUNPLAN command cannot be run, then the error is reported to the application log in the REPORT category. Reports printed to screen will display the error on the screen when printed.

Top of page.

Summary

The @RUNPLAN command enables you to execute events when a report is run. You can set up your contact plans as needed and call the plan from a report or a control file.

The @RUNPLAN command is a powerful feature. You are advised to be careful when you use it to run a contact plan, especially if you use it in a report loop! Please test carefully whenever you call a contact plan with this feature.

tip.gif This feature is available in version CV11.4.3.4 and newer.

Top of page.

See Also

- Contact Plan
- How To Use Control Files
- How To Use the If Conditional
- How To Use Variables
- Report Sample to view all the sample reports and letters
- Report Topics Index to view a list of all report topics.

Top of page.

Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.

Please click this link to send us your comments: helpinfo@collect.org