Inactivating a survey

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 01:49 PM
Hello,
I have a survey defintion that is being replaced with a newly designed one.
In terms of our old surveyu if I inactivate (Active = FALSE) our old survey definition record will this also render the related survey category, survey questions and assessment metric definitions from being seen or used also? Does inactivation of a survey definition cascade to the related survey category, survey questions and assessment metric definitions from being used also? I understand that inactivating a survey will render any open assessments with users assigned that survey from being completed however the previous survey results recorded will be preserved. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2023 06:40 PM
HI @David Neustadt1 ,
I trust you are doing great.
Here's a code snippet to programmatically inactivate a survey definition and its related entities if needed:
// Replace 'your_survey_sys_id' with the sys_id of the survey you want to inactivate
var surveySysId = 'your_survey_sys_id';
// Inactivate Survey Definition
var surveyGr = new GlideRecord('asmt_assessment_definition');
if (surveyGr.get(surveySysId)) {
surveyGr.active = false;
surveyGr.update();
}
// Optional: Inactivate related categories, questions, and metrics
// Note: This requires identifying the relationships and writing additional code
// Add your code here to inactivate related categories, questions, and metrics
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi