There’s an issue in grant management: the GRANT program cannot be shown in the portal.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
SCRIPT INCLUDE
var PublishGrantProgram = Class.create();
PublishGrantProgram.prototype = {
initialize: function() {},
process: function(grantProgramSysId) {
var grantprogramGR = new GlideRecord('sn_svc_appl_pgm_mg_grant_program');
grantprogramGR.get(grantProgramSysId);
if (!grantprogramGR.isValidRecord()) {
return;
}
// 1. Creating a new Record Generator associated with GrantRecord
var recordGenetorSysId=this.createRecordGenerator(grantprogramGR);
// 2. Creating new Catalog Item associated with Grant Program Record
var playbookContentItemRecordSysId = this.createPlaybookContentItem(grantprogramGR, recordGenetorSysId);
// 3 Updating Grant Program with its Catalog Item
var currentGrantProgram = new GlideRecord('sn_svc_appl_pgm_mg_grant_program');
currentGrantProgram.get(grantprogramGR.sys_id);
currentGrantProgram.setValue('playbook_content_item', playbookContentItemRecordSysId);
currentGrantProgram.update();
},
createRecordGenerator: function(grantProgramRecord) {
var recordGenerator = new GlideRecord('sys_playbook_experience_record_generator');
recordGenerator.initialize();
recordGenerator.setValue('create_record_activity_name', 'Answer eligibility question');
recordGenerator.setValue('create_record_form_view', 'Default view');
recordGenerator.setValue('process_definition', '4253b2269f330210dc5c08f9d90a1c3e');
recordGenerator.setValue('table', 'sn_gsm_grants_mgmt_case');
recordGenerator.setValue('template_fields', 'program=' + grantProgramRecord.sys_id + "^product=" + grantProgramRecord.product.sys_id + "^service=" + grantProgramRecord.service.sys_id + '^EQ');
// recordGenerator.setValue('sys_scope','52d5562ac3ff4a10dca65fca05013180');
recordGenerator.insert();
return recordGenerator.sys_id;
},
createPlaybookContentItem: function(grantProgramRecord, recordGeneratorSysId) {
var playbookContentItemRecord = new GlideRecord('sc_cat_item_content');
playbookContentItemRecord.initialize();
playbookContentItemRecord.setValue('name', grantProgramRecord.product.name);
playbookContentItemRecord.setValue('active', true);
// playbookContentItemRecord.setValue('sys_scope','52d5562ac3ff4a10dca65fca05013180');
playbookContentItemRecord.setValue('sc_catalogs', '6691fafb7f9312103a5473f32d8665be');
playbookContentItemRecord.setValue('short_description', grantProgramRecord.summary_statement);
playbookContentItemRecord.setValue('dynamic_content_type', 'c0e6a71443923110f6669c7385b8f20a');
playbookContentItemRecord.setValue('dynamic_content_type', 'c0e6a71443923110f6669c7385b8f20a');
playbookContentItemRecord.setValue('content_type', 'dynamic');
playbookContentItemRecord.dynamic_content_details.table = 'sn_gsm_grants_mgmt_case';
playbookContentItemRecord.dynamic_content_details.parent_sysid = '-1';
playbookContentItemRecord.dynamic_content_details.playbook_experience = '0d71033773f220109edbc1f52ff6a741';
playbookContentItemRecord.dynamic_content_details.query = recordGeneratorSysId;
playbookContentItemRecord.dynamic_content_details.page = "7955e9a77fa992100dd173f32d866523";
playbookContentItemRecord.dynamic_content_details.title = grantProgramRecord.product.name;
playbookContentItemRecord.insert();
// 3.a Available for Table
var availableForUserList = ['d2d2e20557130300d873ac71ef94f9aa', '66c1b50e730333009508738234f6a7c9', '76f09af6cb1200108ad442fcf7076dbf'];
for (var i = 0; i < availableForUserList.length; i++) {
var availableForRecord = new GlideRecord('sc_cat_item_user_criteria_mtom');
availableForRecord.initialize();
availableForRecord.setValue('sc_cat_item', playbookContentItemRecord.sys_id);
availableForRecord.setValue('user_criteria', availableForUserList[i]);
// availableForRecord.setValue('sys_scope','52d5562ac3ff4a10dca65fca05013180');
availableForRecord.insert();
}
// 3.b Not Available For Table
var notAvailableForUserList = ['ee00065b7713121052abc35b8c5a9925'];
for (var j = 0; j < notAvailableForUserList.length; j++) {
var notavailableForRecord = new GlideRecord('sc_cat_item_user_criteria_no_mtom');
notavailableForRecord.initialize();
notavailableForRecord.setValue('sc_cat_item', playbookContentItemRecord.sys_id);
notavailableForRecord.setValue('user_criteria', notAvailableForUserList[j]);
// notavailableForRecord.setValue('sys_scope','52d5562ac3ff4a10dca65fca05013180');
notavailableForRecord.insert();
}
// 3.c
var deleteExternalUserRecord = new GlideRecord('sc_cat_item_user_criteria_no_mtom');
deleteExternalUserRecord.addQuery('user_criteria','66c1b50e730333009508738234f6a7c9');
deleteExternalUserRecord.addQuery('sc_cat_item',playbookContentItemRecord.sys_id);
deleteExternalUserRecord.query();
if(deleteExternalUserRecord.next()){
deleteExternalUserRecord.deleteRecord();
}
// 3.d Creating Taxanomy Topic
var assignedTopicList = ['efb35ed8530422103a547fd520e5e6a1'];
if(grantProgramRecord.category && grantProgramRecord.category != assignedTopicList[0]){
assignedTopicList.push(grantProgramRecord.category);
}
for (var k = 0; k < assignedTopicList.length; k++) {
var assignedTopicRecord = new GlideRecord('m2m_connected_content');
assignedTopicRecord.initialize();
assignedTopicRecord.setValue('topic', assignedTopicList[k]);
assignedTopicRecord.setValue('content_type', '98f9a16553622010069addeeff7b1248');
assignedTopicRecord.setValue('catalog_item', playbookContentItemRecord.sys_id);
// assignedTopicRecord.setValue('sys_scope','52d5562ac3ff4a10dca65fca05013180');
assignedTopicRecord.insert();
}
return playbookContentItemRecord.sys_id;
}
hidePlaybookContentItem: function (playbookContentItemSysId){
var playbookContentItemRecord = new GlideRecord('sc_cat_item_content');
playbookContentItemRecord.get(playbookContentItemSysId);
if(!playbookContentItemRecord.isValidRecord()){
return;
}
playbookContentItemRecord.setValue('active',false);
playbookContentItemRecord.update();
},
type: 'PublishGrantProgram'
};

I created the founding program and form program, and I created the Grant programs. In the image above, one grant program is accepting proposals, and one is ready to publish. The grant program that is accepting proposals isn’t appearing in the GMP portal, as you can see in the image above. I want to display the grant program in the portal, but I’m unable to. If anyone knows how, could you please help with this? I provided everything in the images above. Thanks in advance, team.
Hi Team,
I created the founding program and form program, and I created the Grant programs. In the image above, one grant program is accepting proposals, and one is ready to publish. The grant program that is accepting proposals isn’t appearing in the GMP portal, as you can see in the image above. I want to display the grant program in the portal, but I’m unable to. If anyone knows how, could you please help with this? I provided everything in the images above. Thanks in advance, team.
0 REPLIES 0