Name

global.IhProcessSyncDeactivate

Description

No description available

Script

var IhProcessSyncDeactivate = Class.create();
IhProcessSyncDeactivate.prototype = Object.extendsObject(AbstractAjaxProcessor, {
  execute : function() {
  	var sys_id = this.getParameter('sys_id');
  	return this._process(sys_id);
  },
  
  _process: function(sys_id) {
  	if (!gs.hasRole("ih_process_sync_admin"))
  		return false;

  	// For all child ih_sync_capture_definition records, update state field to inactive.
  	var gr = new GlideRecord("ih_sync_capture_definition");
  	gr.addActiveQuery();
  	gr.addQuery("parent_definition", sys_id);
  	gr.setValue("state", "inactive");
  	gr.updateMultiple();

  	// For all child ih_sync_remote_system records, update inbound_state and outbound_state fields to disabled.
  	gr = new GlideRecord("ih_sync_remote_system");
  	gr.addActiveQuery();
  	gr.addQuery("parent_definition", sys_id);
  	gr.setValue("inbound_state", "disabled");
  	gr.setValue("outbound_state", "disabled");
  	gr.updateMultiple();
  	return true;
  },
  type: 'IhProcessSyncDeactivate'
});

Sys ID

1bcc6ca677fe5010ea415440a8106177

Offical Documentation

Official Docs: