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
Solved! Go to Solution.
Solved by jpiggee. Go to Solution.
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
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!
Thanks for circling back and sharing the solution for all!
Michelle