syntax_editor_macros
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| syntax_editor_macros [01/07/2025 13:00] – created johnsonjohn | syntax_editor_macros [01/07/2025 13:16] (current) – johnsonjohn | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ttt | + | ======Syntax Editor Macros====== |
| + | ---- | ||
| + | =====Client-Side Key Concepts===== | ||
| + | ====JWJ==== | ||
| + | < | ||
| + | //name jwj | ||
| + | //Text | ||
| + | // | ||
| + | c_GeneratingMessages | ||
| + | c_GlideAjaxMethod | ||
| + | c_GlideRecordDatabaseAccess | ||
| + | c_GlideRecordGetReferenceDatabaseAccess | ||
| + | c_ReusableScript | ||
| + | c_ScratchpadDatabaseAccess | ||
| + | c_TryBlock | ||
| + | |||
| + | // | ||
| + | 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(), | ||
| + | |||
| + | //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. | ||
| + | //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(" | ||
| + | |||
| + | g_form.addErrorMessage(" | ||
| + | g_form.addInfoMessage(" | ||
| + | |||
| + | g_form.showFieldMsg(" | ||
| + | g_form.showFieldMsg(" | ||
| + | g_form.showFieldMsg(" | ||
| + | g_form.showFieldMsg(" | ||
| + | |||
| + | jslog(" | ||
| + | |||
| + | g_form.addDecoration(" | ||
| + | g_form.addDecoration(" | ||
| + | g_form.addDecoration(" | ||
| + | |||
| + | g_form.flash(" | ||
| + | |||
| + | var vResult = confirm(" | ||
| + | g_form.addInfoMessage(vResult); | ||
| + | } | ||
| + | </ | ||
| + | ---- | ||
| + | |||
| + | ====c_GlideAjaxMethod==== | ||
| + | < | ||
| + | //text | ||
| + | // | ||
| + | |||
| + | //From client side code, to invoke server side code asynchronously, | ||
| + | //Use the addParam() function, and by convention, the parameter named " | ||
| + | // | ||
| + | //Use getXMLAnswer() to invoke the server-side function and specify a callback function; in this example " | ||
| + | //Use a direct parameter in your callback function to make use of data returned by the server; in this case the parameter is named " | ||
| + | function onLoad() { | ||
| + | g_form.addInfoMessage(" | ||
| + | |||
| + | var ga = new GlideAjax(' | ||
| + | ga.addParam(" | ||
| + | ga.getXMLAnswer(finishClientSideWork); | ||
| + | |||
| + | g_form.addInfoMessage(" | ||
| + | |||
| + | var ga2 = new GlideAjax(' | ||
| + | ga2.addParam(" | ||
| + | ga2.addParam(" | ||
| + | ga2.getXMLAnswer(finishClientSideWorkTWO); | ||
| + | |||
| + | g_form.addInfoMessage(" | ||
| + | } | ||
| + | |||
| + | function finishClientSideWork(answerFomServer) | ||
| + | { | ||
| + | g_form.addInfoMessage(" | ||
| + | g_form.addInfoMessage(" | ||
| + | g_form.addInfoMessage(" | ||
| + | } | ||
| + | |||
| + | function finishClientSideWorkTWO(answerFomServerTWO) | ||
| + | { | ||
| + | g_form.addInfoMessage(" | ||
| + | g_form.addInfoMessage(" | ||
| + | g_form.addInfoMessage(" | ||
| + | } | ||
| + | </ | ||
| + | ---- | ||
| + | |||
| + | ====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.1736283630.txt.gz · Last modified: by johnsonjohn
