Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Scripting Error "item" is undefined

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
MrSJM88
506 Views, 2 Replies

Scripting Error "item" is undefined

I am having some challenges with a script that will create milesstones, triggered by the creation of a record. 

See below for the script created:

 

if(item.milestones.length <=0){
var mStoneDef = [];
mStoneDef['Quote Complete'] = 25;
mStoneDef['Customer Approval'] = 50;
mStoneDef['Implemented'] = 100;

createMileStones(mStoneDef,7,'ENTER',2);
}
{
var someDate = new Date();
var numberOfDaysToAdd = 7;
someDate.setDate(someDate.getDate() + numberOfDaysToAdd);
item.TARGET_QUOTE_DATE=someDate
}

 

 

When I test the script I recieve an "item" is undefined error. I did not set any values in the testing parameters.

Could someone help me out when the get the chance?

 

Thanks,

 

Stephen

2 REPLIES 2
Message 2 of 3
jpiggee
in reply to: MrSJM88

Hi Steve,

 

I know we worked on this offline, but I figure it would be best to swing back to this and also provided the answer hear as well.

 

The script that was being used is correct

  1. The usage of the transition names is correct
  2. The structure of the script is also correct
  3. The creation and placement of the date is also correct.

 

However, what we found was that in our haste to fix and use this script we over looked the library that is required by the function of “createMileStones”.

 

Once this was added to the script in the section “Imports”, we were able to get this running correctly.

 

Nice Job Steve!

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 3 of 3
michelle.stone
in reply to: jpiggee

Thanks for circling back and sharing the solution for all!

 

Michelle



Michelle Stone
Technical Marketing, PDM & PLM
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report