Name

sn_cd.cd_TodoAjax

Description

Content delivery To-do Ajax

Script

var cd_TodoAjax = Class.create();
cd_TodoAjax.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
  /**
   * @ajaxparam {String} sysparm_id - the id of the todo content
   * @return {Boolean} - true if the content has active tasks. false otherwise
   **/
  contentHasActiveTasks: function() {
  	var contentId = this.getParameter('sysparm_id');
  	if (!contentId)
  		return false;
  	
  	var todo = new GlideRecordSecure('sn_cd_task');
  	todo.addQuery('content_todo', contentId);
  	todo.addActiveQuery();
  	todo.setLimit(1);
  	todo.query();
  	return todo.hasNext();
  },
  
  type: 'cd_TodoAjax'
});

Sys ID

b7f5344fe7c53300809a268b03f6a937

Offical Documentation

Official Docs: