identify newest baseline in an array
I'm currently building a scenario in which a change to the project planned completion date triggers the creation of a new baseline for that project. In cases where the project has existing baselines, I'd like to set the most recently entered baseline as the default baseline before creating the new one.
I have 3 baselines in my sample project:
- Original [created by WF when the project was marked Current]
- Baseline02
- Baseline03
I was playing around, and I've been able to (1) sort the baseline array by name; (2) get the ID for Baseline03 based upon the sort; and (3) use the ID in a Custom API module to set Baseline03 as the default baseline.
Although this works, I thought it might be cleaner if I could sort the baseline array by the baseline entry date (rather than worry about our naming conventions for baselines). entryDate is listed as a field in the Baseline object in the API, but I can't seem to sort the array using it as a key.
Is this even possible? Is there a better way to identify the newest baseline?
Thanks.
