Translations of this page:
 

stopCreate()

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])

  • TextID (optional)
    The identifier of a text to be displayed instead of the report (can be NULL).
  • AbortLevel (optional)
    Defines what exactly should be stopped:
    • '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.

Do not Create a Report

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');
}

Do not Send a Serial Mail

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.

en/create/functions/stopcreate.txt · Last modified: 24.01.2025 18:15 by sema.altunoglu
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki