0% found this document useful (0 votes)
472 views

Scriptcase Macros

This document provides a summary of macros and special variables available in Scriptcase that allow users to manipulate events, buttons, applications, security controls, and dates. It includes a table listing macros for SQL, databases, dates, and controls along with descriptions of what each macro does.

Uploaded by

Meliana Wang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
472 views

Scriptcase Macros

This document provides a summary of macros and special variables available in Scriptcase that allow users to manipulate events, buttons, applications, security controls, and dates. It includes a table listing macros for SQL, databases, dates, and controls along with descriptions of what each macro does.

Uploaded by

Meliana Wang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

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_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_error_message ("Text") This macro generate an error message.


sc_exit (Option) This macro forces the application exit.
sc_getfield ('myField') This macro assign the properties of a field to a javascript variable.
sc_get_language This macro returns the abbreviation of the language used.
sc_get_regional This macro returns the abbreviation of the regional settings used.
sc_get_theme This macro returns the application theme name.
This macro dynamically modify the field label displayed in group
sc_groupby_label ("My_Field")
by lines.
This macro loads images passed as parameter to use in the
sc_image (Image01.jpg)
application.
sc_include ("File", "Source") This macro is used to "include" PHP routines.
sc_include_lib ("Lib1", "Lib2", ...) This macro is used to select dynamically the application libraries.
sc_include_library ("Target", "Library Name",
This macro includes a PHP file from a library in the application.
"File", "include_once", "Require")
This macro its used to modify dynamically the grid form field
sc_label ({My_Field})
label.
sc_language This macro returns the language and regional settings.
sc_link (Column, Application, Parameters, This macro dynamically creates or modifies links between grid
"Hint", "Target", Height, Width) applications and other applications.
sc_log_add ("action", "description") This macro will add a register into the log table.
This macro returns what was inserted in the "description" field of
sc_log_split ({description})
the log table in an array format.
sc_mail_send (SMTP, Usr, Pw, From, To,
Subject, Message, Mens_Type, Copies, This macro is used to send e-mails.
Copies_Type, Port, Connection_Type,
Attachment, SSL)
This macro is used to create a string with the link data to another
sc_make_link (Application, Parameters)
application.
This macro update a Master Application object from a Detail
sc_master_value ('Object', Value)
Application.
sc_redir (Application, Parameter01;
Parameter02; Target, Error, height_modal, This macro its used to redirects to other application or URL.
width_modal)
sc_reset_global ([Global_Variable1],
This macro delete session variables received as parameter.
[Global_Variable2] ...)

sc_send_mail_api ($arr_settings) Enables dynamic sending of embedded emails with Mandrill and Amazon SES

sc_send_sms ($arr_settings) This macro is used to send text SMS messages


sc_seq_register This macro provide the register sequential number.
sc_set_global ($variable_01) or ({My_Field}) This macro is used to register session variables.

sc_set_groupby_rule Macro is used to select an specific GROUP BY rule.

This macro allows to dynamically change the application


sc_set_language ('String Language')
language.
This macros allows to dynamically change the application regional
sc_set_regional ('String Regional')
settings.
sc_set_theme ('String Theme') This macro is used to dynamically define the application themes.
This macro verifies if its been used a safe/secure site. (https
sc_site_ssl
protocol)
sc_trunc_num ({My_Field}, Decimal_Number) This macro its used to set the number of decimals.
sc_url_exit (URL) This macro modifies the application exit URL.
sc_url_library ("Target", "Library Name", This macro returns the path of a file, inside a library, to be used on
"File") the applications.
This macro dynamically activates or deactivates warning messages
sc_warning 'on' or 'off'
control.
sc_webservice ("Method", "URL", "Port",
"Send Method", "Parameters Array", "Setting's This macro is used to communicate with a web service.
Array", "Timeout", "Return")
This macro its used to generate ZIP files from a file list and/or
sc_zip_file ("File", "Zip")
directories.
Variables - Totalling Totalling Variables Variables that contains all the totals (general and for grouping).
Variables - Totalling (group by) Totalling
Breaking totals variables.
Variables (group by)
Filter
This macro its used to save the where clause content generated
sc_where_filter
through the filter form.
Security
sc_apl_status ("Application", "Status") This macro Activate/Deactivate the applications at user level.

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_ldap_search ( $filter = 'all', $attributes = Macro to perform searches in the LDAP.


array() )
This macro deletes all the modifications effected by "sc_apl_conf"
sc_reset_apl_conf ("Application", "Property")
macro.
sc_reset_apl_status This macro deletes all the application security status variables.
This macro restores a menu item structure. (removed by the macro
sc_reset_menu_delete
"sc_menu_delete").
This macro its used to enable a menu item structure. (disabled by
sc_reset_menu_disable
the macro "sc_menu_disable").
sc_user_logout ('variable_name', Macro used to log the user out to the system.
'variable_content', 'apl_redir.php', 'target')
Shows
sc_ajax_message ("Message", "Title",
This macro allows the application to display customized messages.
"Parameters", "Parameters_Redir")
Macro to refresh a Grid
sc_ajax_refresh ()

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.

sc_hide_groupby_rule ('group1', 'grop2', Macro used to disable Group By rules.


'group3')
sc_set_focus ('Field') This macro its used to set the focus to a form field.
sc_text_style ({My_Field}, "Background- This macro allows to modify dynamically the text style from the
Color", "Size", "Color", "Family", "Weight") grid field.
Buttons
This macro returns "true" when the "copy" button is selected in a
sc_btn_copy
form.
This macro returns "true" when the "Delete" button is selected in a
sc_btn_delete
form.
This macro shows and hides buttons on the toolbar in execution
sc_btn_display ("Button_Name","on/off")
time.
sc_btn_insert This macro returns "true" when the "Add" button is selected in a
form.
This macro returns "true" when the "Add New" button is selected
sc_btn_new
in a form.
This macro returns "true" when the "Save" button is selected in a
sc_btn_update
form.
PDF
sc_set_pdf_name "sc_my_file_name.pdf" This macro will change the grid's exported files name.
Variables - Authentication Authentication
Variables User/Password for the WEB server.

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_btn_disable ('button_id', 'on/off') Macro used to disable Menu buttons.

sc_menu_delete (Id_Item1) This macro remove items of the menu structure.


sc_menu_disable (Id_Item1) This macro deactivate menu structure items.

sc_menu_force_mobile (boolean) Macro used to force the creation of menus to mobile devices.

sc_menu_item This macro Identifies the menu item selected.

sc_script_name This macro identifies the application name that was selected in the menu.

You might also like