sc_exit(Option)

The macro sc_exit defines the application's behavior after executing a PHP or RUN button. This behavior varies depending on the parameter provided.

Its use is exclusive to buttons of type PHP or RUN

Parameter

Parameters Examples Description

No parameter

sc_exit();

The confirmation screen with the "OK" button will not be displayed, and the user will be redirected to the previous application (if it exists).

ok

sc_exit(ok);

The confirmation screen with the "OK" button will be displayed, and the user will be redirected to the previous application (if it exists).

sef

sc_exit(sef);

The confirmation screen with the "OK" button will not be displayed, and the user will return to the current application, executing the SELECT command of the application again.

ref

sc_exit(ref);

The confirmation screen with the "OK" button will not be displayed, and the user will return to the current application, refreshing the data with a refresh.

ok, sef

sc_exit(ok,sef);

The confirmation screen with the "OK" button will be displayed, and the user will return to the current application, executing the SELECT command of the application again.

ok, ref

sc_exit(ok,ref);

The confirmation screen with the "OK" button will be displayed, and the user will return to the current application, refreshing the data with a refresh.

Parameters for forms and control

The options below are for transaction control and are exclusively for PHP buttons in control and form applications.

Parameters Examples Description
No parameter

sc_exit();

Does not affect database transactions.
c

sc_exit(c);

Performs pending transactions.
r

sc_exit(r);

Does not perform pending transactions.

 

Example

Example of using sc_exit in a RUN button.

// Using in the onRecord event of the RUN button.
$update = "update orders set shipaddress = 'completed' where orderid = ". {orderid};
sc_exec_sql($update);
sc_exit(ref);