Table operation
14 min
overview a table operation is a button or a contextual menu that is used to trigger certain operations examples and types below form detail view appears at the bottom of a form next to the default save buttons examples include "classify interaction" and "set to resolved" buttons on an unclassified interaction record detail config appears as part of a form context menu group, on the top right of a form, after clicking on the vertical ellipsis icon examples include "convert to request" and "create related change" context menu items for an incident record detail context appears as part of a field context menu group, after right clicking on a field on a form examples include "edit available values" on a choice field as an admin related list context appears as part of related list context menu group, after right clicking on a record in a form's related list examples include "approve on behalf of" and "reject on behalf of" on an approvals related list on the itsmrequest form those related list context menus will appear for users with the approval override role list list view appears as a button at the bottom of a list view examples include "import change set" for an admin user in a list of change set records the button is used to start a change set import process on the servicely instance list context appears as part of a list view's contextual menu group on selected records, after right clicking on a record in a list view, e g list of open itsmrequest records examples include "bulk cancel requests" on a list of itsmrequest records list config appears as part of a list view's contextual menu group on top right of a list, after clicking on the vertical ellipsis icon examples include "personalise list" and "remove list personalisation" configuration base field name description example value name name of the configuration incident convert to request label label of the table operation shown to the users convert to request table table of records that this table operation is to be available for note for related list context table operations, the table needs to be what the related list is displaying incident operation type whether to run on server or on client select "execute on server" to run server side script such as modifying record(s) select "execute on client" to run client side script such as redirecting on to another page execute on server is form submit select yes to execute 'on form submit’ ui event handling as part of 'on before' processing of this operation yes active activate/deactivate to show/hide the table operation yes is bulk operation determines whether this table operation should be selectable when updating more than one record at a time in a list not applicable for form displayed table operations no icon icon that will display to the left of the table operation label select from available options do not load full records full records are only needed for list operations that use fields not already on the list view in before and action client scripts this is for performance purposes, therefore the preference is for this to be set as yes, unless necessary show in list view refer to "list view" table operation type example no show in detail view refer to "detail view" table operation type example no show in list context menu refer to "list context" table operation type example no show in related list context menu refer to "related list context" table operation type example no show in detail context menu refer to "detail context" table operation type example no show in list config menu refer to "list config" table operation type example no show in detail config menu refer to "detail config" table operation type example yes separator before determines whether a separator will be shown before the table operation in the config menu display options yes separator after determines whether a separator will be shown after the table operation in the config menu display options no roles if populated, user needs to have at least one of the role(s) added here negate roles if set to yes, then the roles will be negatively matched i e table operation will be accessible if the user does not have any of the roles permission operations add one of more of the access operations 'read', 'create', 'update', 'delete' to restrict access to this table operation based on a user's permissions for the associated table server script will only appear if type is "execute on server" a server side script that executes once a table operation has been run, has met the condition and successfully ran the before script within the script you have access to the current record it is executing on via "current" client script will only appear if type is "execute on client" a client side script that executes once a table operation has been run, has met the condition and successfully ran the before script within the script you have access to the current record it is executing on via "current", as well as the navigate object to navigate to specific pages before this script executes on the client side and is only applicable when the action runs client side within the script you have access to the current record it is executing on via the 'current' variable the current view aspect, e g selfservice, is set in the 'viewaspect' variable on success a client side script that executes if the action has run successfully and there were no errors condition a script that determines whether a table operation shows or not within the script, you have access to the current record it is executing on via "current", as well as the "viewaspect" global variable, and the "tablename" when executed on the client the following global variables are also available "tablename", "formcontext", "formtype" condition scripts executed on the client are wrapped in a function and so should use the "return" statement on failure a client side script that executes if the action did not run successfully or there were errors condition examples (current isnewrecord() === false && viewaspect != "selfservice"); server script examples //note ideal, but this will save the record orignally to ensure attachments and journal entries go over current update(); var newrecid = reclassificationutil reclassifyrecord(current, "incident", "itsmrequest"); //update the closure details current closurenotes("incident has been converted to request " + (table("itsmrequest") get(newrecid) number())); //generally speaking we don't want to update closed tickets, except in cases like this current disablepermissionchecks(); //close this record as a request was made instead workflow\ forcetoactivity("closed", current, true, true); answer = \[{ id newrecid }]; on success examples the response object available in the script, contains the parameters passed in the answer object of the server script dialogapi success("record successfully created taking you there now "); navigate to({ urlelements \["itsmrequest", response id, viewaspect] }); renderer properties you can place a detail view table operation at the bottom right of a form, just like "cancel incident" on incident record, by adding a renderer property the button can also take in colour red by having property of "alert" example below add key = button type value = alert right