Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11 hours ago
Hi All,
I want to update the install group from the 'sn_ms_intune_spoke_sf_config' table to a custom field on the software model table which is in global scope.
I have create below business rule:
BR code:
var IntuneToSAMUtils = Class.create();
IntuneToSAMUtils.prototype = {
initialize: function() {},
updateProductModelSupportLink: function(intuneAppSysId, installGroup) {
if (!intuneAppSysId || !installGroup) {
return;
}
var samModel = '';
// Get model from Intune application
var grApp = new GlideRecord('sn_ms_intune_spoke_application');
if (grApp.get(intuneAppSysId)) {
samModel = grApp.model;
}
if (!samModel) {
return;
}
// Update Software Product Model
var grModel = new GlideRecord('cmdb_software_product_model');
if (grModel.get(samModel)) {
// Avoid unnecessary update
if (grModel.u_product_support_link != installGroup) {
grModel.u_product_support_link = installGroup;
grModel.setWorkflow(false);
grModel.update();
}
}
},
type: 'IntuneToSAMUtils'
};
which call the script include from global scope
Script include:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var grpValue = current.install_group;
if (!grpValue) {
return;
}
var appl = current.application;
var samModel;
var grApp = new GlideRecord('sn_ms_intune_spoke_application');
grApp.addQuery('sys_id', appl);
grApp.query();
if (grApp.next()) {
samModel = grApp.model;
}
var grConfig = new GlideRecord('cmdb_software_product_model');
grConfig.addQuery('sys_id',samModel);
grConfig.query();
if(grConfig.next()){
grConfig.u_product_support_link = grpValue;
grConfig.update();
}
})(current, previous);
also added the cross access privilage record as below:
Just wanted to check if that a correct approach
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11 hours ago
You are on correct path .
Just ensure
- Navigate to the 'sn_ms_intune_spoke_sf_config' table definition.
- Under Application Access, ensure "Allow access to this table via web services and script include" is checked.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11 hours ago
You are on correct path .
Just ensure
- Navigate to the 'sn_ms_intune_spoke_sf_config' table definition.
- Under Application Access, ensure "Allow access to this table via web services and script include" is checked.
