The function `stopCreate()
can be used in the PHP code of result reports to prevent the creation or delivery of a report.
void stopCreate([string TextID, string AbortLevel])
NULL
).'page'
– By default, only the creation of the current page in the report is stopped.'report'
– No result report is created, and either the text TextID is displayed in the browser, or a serial mail is sent without the result report as an attachment.'cancel'
– When sending the result report via serial mail, no mail is sent to the address at all.If a result report is offered in the questionnaire, its creation can be tied to complete data. This IF filter would display the text “MX01” instead of the result report.
if (!empty(getItems('AB01', 'missing'))) { stopCreate('MX01', 'report'); }
If a result report is to be sent as an attachment to a serial mail, the 'cancel'
option can be used to ensure that no serial mail is sent to that person at all. In the following case, no serial mail is sent if no data exists in the Database for Contents for an address entry.
$userID = caseSerial(); $key = 'data-'.$userID; $data = dbGet($key); if (!$data) { stopCreate(NULL, 'report'); }
A text does not have to be created/specified here. Instead, the first parameter can simply be NULL
.