PLM 360 General Discussion

PLM 360 General Discussion

Reply
Mentor
dkeeley
Posts: 224
Registered: ‎10-04-2012
Message 1 of 2 (96 Views)

Milestone Status Flag Error

96 Views, 1 Replies
01-04-2013 01:31 PM

Hi,

 

I have created a milestone via scripting. The target date is +3 days in the future and the warning date is +7 days in the future. However the warning flag shows up as green (on time) when it should be yellow. I have attached a screenshot. My code is as follows;

 

var milestone = item.addMilestone();
var target_date = new Date();

if (item.URGENCY === '1 - High')
{
    target_date.setDate(target_date.getDate()+3);
}
else if (item.URGENCY === '2 - Medium')
{
    target_date.setDate(target_date.getDate()+7);
}
else if (item.URGENCY === '2 - Low')
{
    target_date.setDate(target_date.getDate()+30);
}

milestone.setWorkflowState('[04] Closed');
milestone.milestoneType = 'ENTER';
milestone.milestoneDate = target_date;
milestone.warnThreshold = 7;
milestone.progress = 100;

Product Support
piggeej
Posts: 281
Registered: ‎03-27-2012
Message 2 of 2 (79 Views)

Re: Milestone Status Flag Error

01-07-2013 07:14 AM in reply to: dkeeley

David,

 

Because the warning date is set to occur after the target date, this will always show as green. The milestone will turn to red though once the target date is passed.

 

Always make sure the warning date is < the target date. 



Joe Piggee
Support Specialist
Product Support
Autodesk, Inc.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.