User Tools

Site Tools




The PerspectiumBulkShare object provides a way to access the bulk share configuration record and make changes to it in server side javascript such as in a bulk share's Before/After Bulk Share Script.

To use this object, you first need to initialize it:

Initialize Description Version
PerspectiumBulkShare(bulkshare_gr) initializes PerspectiumBulkShare with a bulk share configuration (psp_bulk_share) GlideRecord v3.6.0
initializes PerspectiumBulkShare with the sys_id of a bulk share configuration (psp_bulk_share) GlideRecord,
optional - pass a condition to query against the bulk share's table
optional - pass a name to give the bulk share's scheduled job that runs in the background to share records

Once initialized, you can reference the PerspectiumBulkShare functions:

Methods Description
addSysId(sys_id) adds the sys_id argument to the bulk share's sys id related list for use with the Share only Sys IDs listed feature. If the “Share only Sys IDs listed” option is not selected on the bulk share, calling this function will select it. Note the “Share only Sys IDs listed” feature only queries the table listed in the bulk share for any sys ids added with this method so if you specify sys ids of a different table they will not be found. For example, in the below code sample, the bulk share is for the ticket table so you would only want to add sys ids of ticket records using addSysId()
clearSysIds() clears all the sys ids in the bulk share's sys_id related list. If the “Share only Sys IDs listed” option is selected on the bulk share, calling this function will deselect the option.
Europium executeNow() runs a bulk share immediately for the sys_id passed in PerspectiumBulkShare. If no sys_id is passed in PerspectiumBulkShare, the following parameters are required for this method:
1. bulk_share_name (string)
2. table_name (string)
3. target_queue_name (string)

Additionally, the following parameters are optional:
1. condition (string); e.g., active=true^EQ)
2. cipher (string); e.g., Unencrypted = 0; TripleDES = 1; AES-128 = 2; Base64 Encode Only = 3; AES-256 = 4
3. table_map (string)

Sample Code:

var pBS = new PerspectiumBulkShare(bulkshare_gr);
var tgr = new GlideRecord('ticket');
tgr.addQuery('state', '1');
    pBS.executeNow('Test Bulk Share', 'incident', 'Test Queue', 'active=true^company=CompanySysID^EQ', '3', 'Test Table Map');
updateset_perspectium_api_bulkshare.txt · Last modified: 2018/11/14 17:38 by timothy.pike