#BLOG : Things Every ServiceNow Developer Must Know : Part 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
1)glide.ui.permitted_tables
By default, system tables are restricted from reporting and data visualization. However, in certain scenarios, access to these tables is required for reporting purposes. While creating reports or data visualizations, we often need to use commonly referenced tables such as Email [sys_email], which are not available by default in reporting and data visualization modules.
To get their access
I). Navigate to System Properties > UI Properties (sys_properties.list)
II) Search for the property “glide.ui.permitted_tables”
III) Add Your required table there, then we can access those tables in reporting also .
2)GlideSysAttachement.copy('sourceTableName','sourceRecordSysID','targetTableName','targetRecordSysId');
Copies attachments from the source record to the target record.
var attachment = new GlideSysAttachment();
var incidentSysID = 'ab1b30031b04ec101363ff37dc4bcbfc';
var incGR = new GlideRecord('incident');
incGR.get(incidentSysID);
var copiedAttachments = attachment.copy('incident', incidentSysID, 'problem', incGR.getValue('problem_id'));
gs.info('Copied attachments: ' + copiedAttachments);For more GlideSysAttachment methods you can refer this : GlideSysAttachment
3)GlideMultipleUpdate API
var GM= new GlideMultipleUpdate(table_name);
GM.addQuery('field_name', value);
GM.setValue('field_name', value);
GM.execute();
This method updates all records that match the query very quickly. It does not update system fields like sys_updated_on and sys_updated_by, and it does not trigger Business Rules or workflows. Therefore, it should only be used when you need a fast bulk update and do not require auditing, tracking, or business logic execution .
4)&CSV&sysparm_default_export_fields=all
When you try to export records at that time sys_id will not get export by default if we want to get that sys_id also at that time you can use above parameters
steps: 1)navigate to target table
2)add filter to get only required records
3)simply add this &CSV&sysparm_default_export_fields=all in your url , press enter , then records with their sys_id start downloading .
5)SncTriggerSynchronizer.executeNow()
The SncTriggerSynchronizer.executeNow() method in ServiceNow is used to run a scheduled job on-demand from a server-side script. It forces the selected scheduled job or scheduled script execution to execute immediately, rather than waiting for its configured time interval.
var jobRec = new GlideRecord('sysauto_script');
if (jobRec.get('name', 'Your Scheduled Job Name Here'))
{
SncTriggerSynchronizer.executeNow(jobRec);
}
You can also explore :
Things Every ServiceNow Developer Must Know : part 1
Things Every ServiceNow Developer Must Know : Part 2
Things Every ServiceNow Developer Must Know : Part 3