- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2024 11:05 AM
Hi All,
When the due diligence request is created and moved to 'IRQ in process' state by clicking on the button 'Start Onboarding' a new internal assessment record is created automatically. In the internal assessment record, I want to automatically assign one questionnaire to the internal assessment.
Any suggestions on how to achieve this?
thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2024 07:18 AM
Hi Devanshi,
probably easiest to create a BR that adds the questionnaire to the INA on creation of the DD (or whenever the trigger suits your needs best). The example below does the trick.
// create new INA
var grIRQ = new GlideRecord("sn_vdr_risk_asmt_internal_assessment");
grIRQ.initialize();
grIRQ.dd_request = current.sys_id;
grIRQ.name = "IRQ";
grIRQ.short_description = "IRQ";
grIRQ.tiering_assessment_assessors = current.vendor.vendor_manager.toString();
grIRQ.assigned_to = current.vendor.vendor_manager.toString();
grIRQ.vendor = current.vendor;
irqId = grIRQ.insert();
// identify your questionnaire template sys_id
var grQuest = new GlideRecord("asmt_metric_type");
grQuest.query("name", "Default IRQ");
if(grQuest.next()) {
var questId = grQuest.sys_id;
}
// insert m2m to add questionnaire to INA
var grQuestToINA = new GlideRecord("sn_vdr_risk_asmt_m2m_tiering_asmt_questionnaire");
grQuestToINA.initialize();
grQuestToINA.metric_type = questId;
grQuestToINA.vdr_tiering_assessment = irqId;
grQuestToINA.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2024 07:18 AM
Hi Devanshi,
probably easiest to create a BR that adds the questionnaire to the INA on creation of the DD (or whenever the trigger suits your needs best). The example below does the trick.
// create new INA
var grIRQ = new GlideRecord("sn_vdr_risk_asmt_internal_assessment");
grIRQ.initialize();
grIRQ.dd_request = current.sys_id;
grIRQ.name = "IRQ";
grIRQ.short_description = "IRQ";
grIRQ.tiering_assessment_assessors = current.vendor.vendor_manager.toString();
grIRQ.assigned_to = current.vendor.vendor_manager.toString();
grIRQ.vendor = current.vendor;
irqId = grIRQ.insert();
// identify your questionnaire template sys_id
var grQuest = new GlideRecord("asmt_metric_type");
grQuest.query("name", "Default IRQ");
if(grQuest.next()) {
var questId = grQuest.sys_id;
}
// insert m2m to add questionnaire to INA
var grQuestToINA = new GlideRecord("sn_vdr_risk_asmt_m2m_tiering_asmt_questionnaire");
grQuestToINA.initialize();
grQuestToINA.metric_type = questId;
grQuestToINA.vdr_tiering_assessment = irqId;
grQuestToINA.insert();