Name
global.ProjectRecalculationConstraints
Description
No description available
Script
var ProjectRecalculationConstraints = Class.create();
ProjectRecalculationConstraints.prototype = Object.extendsObject(BaseRecalculationConstraints, {
program: function(programSysId) {
var gr = new GlideRecord('pm_program');
gr.get(programSysId);
return gr;
},
getConstraints: function(projectRecord) {
//gs.info('Into ProjectRecalculationConstraints');
var recalculationConstraint = new SNC.RecalculationConstraint();
if(JSUtil.notNil(projectRecord.getValue('top_program'))) {
//gs.info("Top Program : " + projectRecord.getValue('top_program'));
var programRecord = this.program(projectRecord.getValue('top_program'));
//gs.info("Top Program Start Date: " + programRecord.getValue('start_date'));
var leastStartDate = programRecord.getValue('start_date');
recalculationConstraint.addNodeLeastStartDateConstraint(projectRecord.getValue('sys_id'), leastStartDate);
//gs.info('Top program exists for this project, Attaching the Least Start Date to the constraint: ' + leastStartDate);
}
return recalculationConstraint;
},
type: 'ProjectRecalculationConstraints'
});
Sys ID
847e27719f301200598a5bb0657fcf20