LogiUpSkill

Journal

How to remove the comment or work note from activity in Servicenow How to remove the comment or work notes from activity in Servicenow. Lets go from basic i.e. comment and work notes are Journal Input type of field in servicenow. Journal field type in Service-now 1.journal         – Stored the data and can show all the data at once in form and list view. 2.journal_input   – Stored the data and can not show all the data at once in form and list view. 3.journal_list    – Used to display the data Delimiter in Journal entires  “nn” Properties regarding Journal Entries 1.glide.history.max_entries  –  Max number of journal entries included in activity. 2.glide.email.journal.lines  – Max number of journal entries included in email notification.  Important tables regarding Journal Fields: 1.sys_journal_field – stored all the journal field type field values 2.sys_history_line –  Stores the all audited field changes How to remove the comment or work notes from activity. 1. For example we need to remove the below hightligheted additional comment from incident. 2. So this entry was stored in 2 tables.     2.1 sys_journal_field – stored all the journal field type field values     2.2 sys_history_line –  Stores the all audited field changes 3. First one is sys_journal_field – where all the jeneral fields value get stored  and we need to find the record with filter condition like      3.1 value contains the value in additional comment     3.2 Element id will be a sys_id or record     3.3 table will be a table name Please refer the below screen shot for reference.     Delete the selected record from sys_journal_field. 4. but still you can see the additional comment on the incident form because we still need to remove the comment entry from table “sys_history_line” 5.”sys_history_line” table stored the history of audited fields.    5.1 set = “sys_id of incident record” –     5.2 field contains “comments”    5.3 Here you can search using Username column name as well. Please refer the below screen shot for reference.    Delete the selected record from sys_history_line.   6.After deleting the above two entries,the additional comment will get removed from the system or activity.

Datalookup in Service-now

Datalookup in Service-now Data LookUp : This is the rule table that defines the rules that automatically set one or more field values when certain conditions are met. (At client side) For example , in the Incident table we can set the value of “Assigned to” field depending on the combination of “Category” and “SubCategory” fields. Say , if “Category” is “Hardware” and “Subcategory” is “Keyboard” then Set “Assigned to” as “John”   Problem Statement : Set the values for Address and User according to Name . Create Data Lookup Table : Create a new table as a data lookup table.   To create data lookup table,it must extend the Data Lookup Matcher Rules [dl_matcher]        table, as shown in below snapshot,  Save the above table. Create the same fields as in the Source table (table for which this data lookup table is created) for which we want to set the rule.  As per the problem statement,  Create fields: Name,Address and User in “Demo Rule Table”.      Save above changes. Now Open the Demo Rule table (Data lookup table) and set the values for the fields as below, Set all the values that we required,(see the list below), Create Data Lookup Rules:   Now map the data lookup table and Source table. For that follow the following steps, Navigate to Data Lookup Definitions and Click on New Button.  Click on Data Lookup Rule. The following form will be displayed, Write Source table On which we want to apply the rule and Matcher Table in which we have created fields on which we have to set the Rule, Check checkboxes, Active : (run on client side) Select this check box to run this data lookup rule. Clear the check box to ignore this data lookup rule.   Run on Form change : (run on client side) Select this check box to automatically look up values whenever a user or onChange client script changes a field value on a source table form.   Run on insert : (run on server side) Select this check box to automatically look up values whenever a user creates a new record.   Run on update : (run on server side) Select this check box to automatically look up values whenever a user saves or updates a record.   Save this Form. Open the saved  Data Lookup Definitions , At the bottom, Click on “Matcher Field Definitions ” tab and Click on New button, following form will be displayed. Map the Source table and Matcher table(Data lookup table) fields as shown in above snapshot, Check the “Exact  lookup match “ checkbox if you want to make it case sensitive. Save the above changes. Now Click on “Setter Field Definitions” and Click on New Button as shown in below snapshot, Map the fields that we want to set the values depending on the Matcher Field Definitions as below, Set all the fields, Now Open the new form for the source table. Type Name as “Ashwini” . The fields “Address” and “User” will be automatically populated as “Pune” and “Ashwini More” respectively. See below snapshot, But if we change Name to another name , Say Sonia the Address and User values does not change. (see below snapshot) Because in Data Lookup Definitions, In Setter field Definitions , we have set the Always Replace value to false. Set the value of “Always Replace“ as “true” for all fields.(See below snapshot) Save above changes and check again in the source table.

Domain Separation In Service-now

Domain Separation In Service-now  1. MSP –Managed Service Providers  2. It is a paid plugin, user needs a Maint Role to activate the plugin in your instance.  3. It is a logically defined entity used to             1. Separate Data             2. Separate Process             3. Administrative Tasks   4. MSP deals with which user can see and access what data   5. By structure Service now has a Single Tenant Architecture but by using MSP plugin it can be used as Multi-Tenant Architecture   6. Multi-Tenant: It is a structure of application where single instance of the application serves multiple customers by sharing the application properties and a single database.   7. Service now with MSP Plugin:                1. Service now with MSP  Plugin acts as a Multi-Tenant architecture where single instance serves multiple customers using single database.                2. Each customer data is isolated and remains invisible to other customers.   8. When we should not go with MSP Plugins-              1. In case of total separation of all system properties              2. Does not require the global reporting              3. Does not require a single global processes   9. System will not support the following tables from being domain Separated                Access Control [sys_security_acl]                Script Includes [sys_script_include]                System Property [sys_properties]                Dictionary Entry [sys_dictionary]               Dictionary Entry Override [sys_dictionary_override]  10. Domain Scope:        Domain scope defines what users can(data) and cannot access(data) and how(Process).             1. Session Scope Domain             2. Record Scope Domain             1. Session Scope Domain:                           a. User Domain                             b. User domain Picker Domain                          Session domain of users is nothing but the user record domain if we have the user domain and the domain picket domain is the same in case of not,                                       session domain is the same like the domain which use has selected from domain picker.                         Users from parent domain they can change their session domain by changing from Domain picker.   2. Record Scope Domain:               a. It is nothing but the domain of that targeted record.               By Default the record scope take precedence over the session scope   11. We have following domains which has some special meanings.                Global Domain:               a. All the records which we have before enabling the MSP plugin, are part of global domain.               b. Guest user is a part of global.  Default Domain:                a. We can set any domain as a default domain but only one can be a default domain.                b. If you set default domain in an instance, instance will replace the global domain with default domain whenever the record creation happens. Primary Domain:              a. Only the domain which does not have parent can be set as primary domain.

Table Names in Service-now

Table Names in Service-now Users – sys_user Roles – sys_user_role Group – sys_user_group Contains Roles – sys_user_role_contains UserRole mapping – sys_user_has_role GroupMember – sys_user_grmember Application menu – sys_app_application Modules – sys_app_module Choice – sys_choice Business Rules – sys_script UI Actions – sys_ui_action Client Script – sys_script_client Plugins – v_plugins Syntax Editor macros – syntax_editor_macro Dictionary Entries – sys_dictionary Tables – sys_db_object Remote Instance – sys_update_set_source Retrieved Update Sets – sys_remote_update_set Update Set Log – sys_update_set_log Local Update Set – sys_update_set Incident – incident Task – task Problem – problem Change request – change_request Field Classes – sys_glide_object Form Sections or Layouts  – sys_ui_section Views – sys_ui_view Dictionary Entry Override – sys_dictionary_override Request – sc_request Catalog Item – sc_cat_item Requested Item – sc_req_item Catalog Task – sc_task

Reference Qualifier in Service-now   

Reference Qualifier in Service-now 1. Reference Qualifier   :- It is used for filtering. They help refine the choices available in a reference field by defining conditions that the referenced records must meet. A reference qualifier is a filter applied to a reference field to restrict or refine the list of records that users can select from.  If you want to set default value of reference field as current user javascript:gs.getUserID(); Types of reference qualifier:- 1. Simple Reference Qualifier: –  A simple reference qualifier in Service Now is often written as an encoded query string or a Glide Record query. It’s used to filter the choices available in a reference field based on specific criteria.Uses simple AND/OR conditions to filter records. For example, you can show only users where “Active” is “true”.  How to Reach Reference Qualifier in OOB Table or Custom Table:  Open any Table of Your Choice: – Incident/Problem/Change. Step 1:-Application Navigator>Table>Open Existing Record or Create New. Step 2:- Right Click on Any Reference Field i.e. assigned to and Configure Dictionary Step 3:- We are showing Reference Specification and applying Condition. 2. Dynamic Reference Qualifier: – Dynamic reference qualifiers enable you to use a dynamic filter option to run a query against a reference field to filter the returned data set. Dynamic filter options are stored filters that can contain encoded query strings, JavaScript, or script includes, and can be used in multiple dynamic reference qualifiers. Changes made to a dynamic filter option automatically apply to all reference qualifiers that use the same dynamic filter option. Use this type of reference qualifier when you want to use the same filter on multiple forms or to provide filter functionality to “non-code savvy” implementers. The base instance provides several OOB dynamic filter options. If a dynamic filter option that meets your needs does not exist, you can create a new dynamic filter option that is specific to your requirements.All the available dynamic filters are stored in system definition>dynamic filter options.For creating the dynamic reference qualifier we must have a record in this dynamic filter options.After creating the dynamic reference qualifier you can add that filter from the Dynamic  Ref qual field. 3.Advanced Reference Qualifier: – Advanced reference qualifiers enable you to define an inline encrypted query string or JavaScript (actual code or the name of an existing script include or business rule) filter directly in the Reference qualified field of the reference qualifier. Similar to the other reference qualifier types, when the form loads, the filter is executed, and only the records that match the filter appear in the reference field. Use this type of reference qualifier for implementations that only require a simple, unique filter that cannot be handled by a simple reference qualifier, and is not used across multiple reference fields. Here Is Explanation of the code javascript: “sys_id IN” + new getgroupusers().getUser(current.u_assignment_group) 1.new getgroupusers().getUser(current.u_assignment_group) Calls the Script Include you created (getgroupusers). Passes the value of u_assignment_group (a group sys_id) to the function. The Script Include returns a comma-separated list of user sys_ids. 2. “sys_id IN” + This constructs a valid encoded query. Another way for doing Advanced reference qualifier is script include Step 1:-Application Navigator>Script Include> Create New. Step 2:- New<Name (getgroupusers)<Glide AJAX enabledScript Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo. Here Is The Code :- var getgroupusers = Class.create(); getgroupusers.prototype = Object.extendsObject(AbstractAjaxProcessor, {     getUser: function(id) {         var gr = new GlideRecord(“sys_user_grmember”);         gr.addQuery(“group”, id);         gr.query();         var arr = [];         while (gr.next()) {             arr.push(gr.getValue(“user”).toString())         }         return arr.join(‘,’);     },     type: ‘getgroupusers’ });   Here Is the code Explanation in Detail :-  Script Include named getgroupusers that extends AbstractAjaxProcessor, meaning it can be called from a client script (AJAX call). Function: getUser(id) This function returns a comma-separated list of user sys_ids belonging to a given group sys_id.  Step-by-step breakdown var getgroupusers = Class.create();getgroupusers.prototype = Object.extendsObject(AbstractAjaxProcessor, { Defines a Script Include. Inherits from AbstractAjaxProcessor → allows server-side methods to be called from client-side. 1. Query the sys_user_grmember table var gr = new GlideRecord(“sys_user_grmember”);gr.addQuery(“group”, id);gr.query(); Looks at the User Group Member Filters where group equals the passed id. Runs the query. 2. Build array of user sys_ids var arr = []; while (gr.next()) {    arr.push(gr.getValue(“user”).toString());} Loops over each record. Pushes the user field value (sys_id) into an array. 3. Return a comma-separated string return arr.join(‘,’);   Here is the Output  :- Here, we get the group members in the Assigned To field from the group that we selected in the Assignment Group. This dynamic behavior ensures that the Assigned To field is populated only with valid group members, reducing manual errors and ensuring that work items are always assigned to users who actually belong to the selected group.