Professional Documents
Culture Documents
Scriptcase Macros
Scriptcase Macros
Scriptcase Macros
Scriptcase has macros and special variables that allow the user to manipulate events, buttons, applications, security control,
manipulate with dates, etc.
Follows a table of all macros and special variables from ScriptCase, including the list of applications that works for each one.
SQL
sc_begin_trans ("Connection") This macro starts a set of transactions in the database.
sc_change_connection ("Old_Connection",
This macro dynamically change the application connections.
"New_Connection")
sc_commit_trans ("Connection") This macro effective a set of transactions in the database.
sc_concat With this macro you can concatenate fields on select for every database.
sc_connection_edit ("Connetion_Name",
This macro edits an existing connection at runtime.
$arr_conn)
sc_connection_new ("Connection_Name",
This macro creates new connections dynamically.
$arr_conn)
This macro deactivates the Scriptcase standard database error treatment message
sc_error_continue ("Event") for an event.
This macro configure the variable that contains the database error
sc_error_delete
message that can occurs during the exclusion of a record.
This macro configure the variable that contains the database error
sc_error_insert
message that can occurs during the addition of a record.
This macro configure the variable that contains the database error
sc_error_update
message that can occurs during the update of a record.
This macro execute SQL commands passed as parameter or a SQL
sc_exec_sql ("SQL Command", "Connection")
command in the SQL field action type.
sc_lookup (Dataset, "SQL Command", This macro executes a SELECT command stored in the second
"Connection") parameter and returns the data in a variable.
This macro erases the changes made using
sc_reset_change_connection
"sc_change_connection".
This macro undoes the connection edits made by macro
sc_reset_connection_edit
"sc_connection_edit".
This macro undoes the connections made by the macro
sc_reset_connection_new
"sc_connection_new".
sc_rollback_trans ("Connection") This macro discards a set of transations in the data base.
sc_select (dataset, "SQL Command", This macro executes the commands passed in the second
"Connection") parameter and returns the dataset in a variable.
This macro modify dynamically a field that will be recovered in
sc_select_field ({Field})
the grid.
This macro modify dynamically the grids "ORDER BY" clause
sc_select_order ("Field") field.
This macro adds dynamically a condition to the grid WHERE
sc_select_where (add)
clause.
This macro allows to change the type of return from the dataset of
sc_set_fetchmode (parm);
the select commands
sc_sql_injection ({My_Field}) or This macro is used protect the field/variable against "SQL
($My_Variable) injection".
This macro protects the value passed as parameter according with
sc_sql_protect (Value, "Type", "Connection")
the used database.
This macro is used to make a reference of the where clause
sc_where_current
currently used.
This macro saves the where clause content of the original
sc_where_orig
application select.
Global variables containing database access values used by main
Variables - Database Database Variables
connection.
Date
This macro calculates and returns increments and decrements
sc_date (Date, "Format", "Operator", D, M, Y)
using dates.
sc_date_conv ({Field_Date}, "Input_Format", This macro converts the date field passed as parameter with an
"Output_Format") input format to another field with an output format.
sc_date_dif ({Date1}, "Format Date1", This macro calculates the difference between two dates (passed as
{Date2}, "Format Date2") parameters) returning the result in days.
sc_date_dif_2 ({Date1}, "Format Date1", This macro calculates the difference between two dates returning
{Date2}, "Format Date2", Option) the amount of days, months and years.
sc_date_empty ({Field_Date}) This macro checks if a date field its empty retuning a boolean.
sc_time_diff ({datetime_01}, "Date_01 Calculate difference in hours, returning the amount of hours,
Format", {datetime_02}, "Date_02 Format") minutes and seconds.
Control
sc_ajax_javascript ( 'JavascriptMethodName', This macro allows the execution of JavaScript methods in
array("parameter")) form/control events
sc_alert ("Message") This macro shows a Javascript alert message screen.
sc_apl_conf ("Application", "Property",
This macro modify the application execution property.
"Value")
sc_calc_dv (Digit, Rest, Value, Module,
This macro calculate verify digits.
Weights, Type)
sc_call_api ($profile, $arr_settings) This macro allows us to use as integrated Scriptcase APIs
sc_changed ({Field_Name}) This macro returns "true" if the field name have been changed.
sc_confirm ("Message") This macro shows a Javascript confirm screen.
This macro returns the encrypted field or variable to its original
sc_decode ({My_Field})
value.
sc_encode ({My_Field}) This macro returns the field or variable with the content encrypted.
This macro Interrupts the application execution if there are error messages
sc_error_exit (URL, "Target") or
(My_Application, "Target") generated by the macro "sc_error_message".
sc_send_mail_api ($arr_settings) Enables dynamic sending of embedded emails with Mandrill and Amazon SES
sc_ldap_login This macro establish the connection with the user credentials.
sc_ldap_logout () Macro used to release the connection after using the macro sc_ldap_login
sc_get_groupby_rule () This macro provides the name of the Group By rule running at the time.
sc_menu_force_mobile (boolean) Macro used to force the creation of menus to mobile devices.
sc_script_name This macro identifies the application name that was selected in the menu.