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.
sc_select_order ("Field") This macro modify dynamically the grids "ORDER BY" clause
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_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_block_display (Block_Name, on/off) This macro dynamically show/hide the fields of a specific block.
sc_field_color ("Field", "Color") This macro changes the color of a determined field text.
sc_field_disabled ("Field_Name = True/False", This macro is used to block a field to get any data that would be typed on it.
"Parameter")
sc_field_disabled_record ("Field_Name = This macro has the objective to block the typing on determined
True/False", "Parametre") fields in the Forms.
sc_field_display ({My_Field}, on/off) This macro dynamically display or not a specific field.
This macro is intended to inhibit the query fields on the initial
sc_field_init_off (Field1, Field2,...)
load.
sc_field_readonly ({Field}, on/off) This macro dynamically set a form field attribute to '"Read-Only"
sc_field_style ({My_Field}, "Background-
This macro allows to modify dynamically the grid field style.
Color", "Size", "Color", "Family", "Weight")
sc_format_num ({My_Field}, "Group_Symb",
"Dec_Symb", "Amount_Dec", "Fill_Zeros",
This macro its used to format numerical values.
"Side_Neg", "Currency_Symb",
"Side_Currency_Symb")
sc_format_num_region ({My_Field}, This macro has the objective to format numbers, using the regional
"Qtde_Dec", "Insert_Zeros", "Monetary_Sym") settings
sc_form_show 'on' or 'off' This macro dynamically show or not the form.
sc_get_groupby_rule () This macro provides the name of the Group By rule running at the time.
Menu
sc_appmenu_add_item ("Menu_Name",
"Id_Item", "Id_Parent", "Label", "Aplication", This Macro adds dinamically an item to the menu.
"Parameters", "Icon", "Hint", "Target")
sc_appmenu_create ("Menu_Name") This macro dynamically creates a menu item.
sc_appmenu_exist_item ("Menu_Name",
This macro checks if there is a menu item.
"Id_Item")
sc_appmenu_remove_item ("Menu_Name",
This macro removes dynamically a menu item.
"Id_Item")
This macro reset the array used in the dinamically creation of a
sc_appmenu_reset ("Menu_Name")
menu application.
sc_appmenu_update_item ("Menu_Name",
"Id_Item", "Id_Parent", "Label", "Aplication", This macro updates a menu item.
"Parameters", "Icon", "Hint", "Target")
sc_script_name This macro identifies the application name that was selected in the menu.