sc_label("field_name")

This macro allows dynamically changing the label of fields in grid, form, and control applications.

Parameters

The macro has only one mandatory parameter, which receives the name of the field whose label will be changed.
This parameter must be provided in quotes (double or single) or by a variable, as in the syntax examples below. 

//Providing as a string
sc_label("customerid") = "New label for the field";

//Providing with a variable
$var_
field = "field_name";
sc_
label($var_field) = "New label for the field";

 

Examples

Ex. 1: User Registration
In this scenario, a single form is used to register employees and customers.

if ({user_type} == 'customer') {
    sc_label('field_id') = 'Customer ID';
} else {
    sc_label('field_id') = 'Employee ID';
}

 

Ex. 2: Event Registration
In an event registration form, the field labels can be changed to reflect the type of event (e.g., Conference, Workshop, Seminar). 

if ({event_type} == 'conference') {
    sc_label('location') = 'Conference Location';
} else if ({event_type} == 'workshop') {
    sc_label('location') = 'Workshop Location';
} else if ({event_type} == 'seminar') {
    sc_label('location') = 'Seminar Location';
}