syntax_editor_macros
This is an old revision of the document!
Table of Contents
Syntax Editor Macros
Client-Side Key Concepts
JWJ
//name jwj //Text //Client-Side Key Concepts c_GeneratingMessages c_GlideAjaxMethod c_GlideRecordDatabaseAccess c_GlideRecordGetReferenceDatabaseAccess c_ReusableScript c_ScratchpadDatabaseAccess c_TryBlock //Server-Side Key Concepts s_AjaxFunctionDefinition s_CurrentAndPreviousGlideRecordObjects s_EventDefinitionAndTriggering s_ExcelFileProcessing s_GeneratingMessages s_GlideRecordDatabaseAccess s_GlideRecordDatabaseInsert s_JavaScriptArrays s_JavaScriptObjects s_LibraryClassAndFunctionUsage s_LibraryClassDefinition s_LibraryFunctionDefinition s_MailScript s_ScratchpadPopulation s_SetRedirectURLFunction s_TryBlock
c_GeneratingMessages
//text
//alert(), addInfoMessage(), showFieldMsg(), jslog(), addDecoration()
//Context: Most client side code.
//Ways to generate messages from client side code:
//Use the alert() function to show a prominent and blocking modal dialog which must be explicitly dismissed for execution to continue.
//Display a message to the user from Client code using g_form.addInfoMessage() or g_form.addErrorMessage()
//Use g_form.addDecoration() to show a small graphic symbol by a form field label. A mouse-over popup hint may be included, and a color may be specified.
//Use g_form.flash() to display a flashing colored background box behind a form field label.
//Use the confirm() function to display a modal popup dialog to get a response (OK or Cancel) from the user before continuing execution.
//Use the jslog() function to write a message to the web browser console.
function onLoad() {
alert("My Alert Message"); //Modal dialog with OK button.
g_form.addErrorMessage("My Error Message"); //Wide message at top of form in Red.
g_form.addInfoMessage("My Info Message"); //Wide message at top of form in Blue.
g_form.showFieldMsg("name", "My Field Message"); //Message UNDERNEATH field. Same width as field. Displayed in blue.
g_form.showFieldMsg("name", "My Field Message - info", "info"); //Again, message UNDERNEATH field. Same width as field. Displayed in blue.
g_form.showFieldMsg("name", "My Field Message - error", "error"); //Message UNDERNEATH field. Same width as field. Displayed in red.
g_form.showFieldMsg("name", "My Field Message - warning", "warning"); //Message UNDERNEATH field. Same width as field. Displayed in orange.
jslog("My jslog Log"); //Sends a message to the web browser console log seen using F12.
g_form.addDecoration("name", "icon-user", "This icon is called icon-user"); //Icon to the left of field.
g_form.addDecoration("name", "icon-tree", "This icon is called icon-tree", "color-green");
g_form.addDecoration("name", "icon-lightbulb", "This icon is called icon-lightbulb", "color-red");
g_form.flash("name", "#AAFACD", -4); //Yellow highlight bar over field for 4 seconds.
var vResult = confirm("My Confirmation Message") ? "User clicked OK" : "User clicked Cancel"; //Modal dialog with 2 buttons.
g_form.addInfoMessage(vResult); //Wide message at top of form in Blue.
}
c_GlideAjaxMethod
c_GlideRecordDatabaseAccess
c_GlideRecordGetReferenceDatabaseAccess
c_ReusableScript
c_ScratchpadDatabaseAccess
c_TryBlock
Server-Side Key Concepts
s_AjaxFunctionDefinition
s_CurrentAndPreviousGlideRecordObjects
s_EventDefinitionAndTriggering
s_ExcelFileProcessing
s_GeneratingMessages
s_GlideRecordDatabaseAccess
s_GlideRecordDatabaseInsert
s_JavaScriptArrays
s_JavaScriptObjects
s_LibraryClassAndFunctionUsage
s_LibraryClassDefinition
s_LibraryFunctionDefinition
s_MailScript
s_ScratchpadPopulation
s_SetRedirectURLFunction
s_TryBlock
syntax_editor_macros.1736284457.txt.gz · Last modified: by johnsonjohn
