1

 


Let's say you use javascript to get the active stage, and then the step collection (using code similar to this - https://neilparkhurst.com/2015/11/01/crm-business-processes-and-javascript/).  When you iterate, some steps may return as "undefined".  It looks like with the added ability of attaching workflows to stage changes, those now get returned in a call to stage.getSteps, but return as undefined.  So let's say you have 3 fields as steps in your stage, and then 2 workflows set to go on stage exit.  When you call stage.getSteps, your collection length will be returned as 5.  3 will be your 3 fields, and the other 2 will be undefined.  So when you're iterating, you just have to add in a check for undefined before trying to get the name or any properties of the step, otherwise the js will throw an error.


If there's any ability to do anything with these in javascript, then they should return actual data.  If not (which I suspect is the case), then they should not return anything in this function call, rather than the current "undefined".

STATUS DETAILS
Declined
Ideas Administrator

Thank you for your feedback. We are declining/closing this idea as it has been open for more than 2 years and has not received sufficient numbers of votes. If the idea is still valid, request you to re-submit the idea.