Database Reference
In-Depth Information
essSvr = essHome.signOn('user', 'pass', false, null, 'embedded',
'ess_server')
essCube = essSvr.getApplication('GL').getCube('GL')
essOtl = essCube.openOutline(false, true, false)
essCalMbr = essOtl.findMember('Calendar')
essYrMbr = essCalMbr.createChildMember('FY13', essOtl.
findMember('FY12'))
essYrMbr.setAlias(null, '2013')
essYrMbr.updatePropertyValues()
wkOfYr = 52
aliasDate = new Date('12/27/2013') // the last Friday of the fiscal
year
(4..1).each { qtrNum -> // Q4 to Q1
essQtrMbr = essYrMbr.createChildMember("Q${qtrNum} FY13")
(3..1).each { mthNum -> // 3 mths per qtr
mth = new Date("${(qtrNum-1)*3 + mthNum}/1/2012").
format('MMM')
essMthMbr = essQtrMbr.createChildMember("${mth} FY13")
(5..1).each { wkNum -> // up to 5 wks in a month
if (wkNum < 5 || mthNum == 2) { //5 wks in the qtr's
2nd mth
essWkMbr = essMthMbr.createChildMember("Week${wkO
fYr--} FY13")
essWkMbr.setAlias(null, "${mth}Wk${wkNum} FY13")
essWkMbr.setAlias("Close Dates", aliasDate.
format("'d'MM/dd/yy"))
essWkMbr.updatePropertyValues()
essWkMbr = null
use (TimeCategory) { aliasDate -= 7.days } //roll
back the calendar
}
}
essMthMbr = null
}
essQtrMbr = null
}
essYrMbr = null
essCalMbr = null
essOtl.save(EEssRestructureOption.KEEP_ALL_DATA)
essOtl.close(); essCube.clearActive(); essSvr.disconnect();
essHome.signOff();
We create the members in reverse. We start with Q4, December, and week 52 and
work backward through time. This is because, by default, createChildmember adds the
new member as the first child of the parent. rolling with that, we add the members in
an order that keeps us from having to sort the outline later.
9.5.9 Unlocking Objects
often, when applications crash, are not exited properly by the user, or time out, they
may fail to clean up their operations and release the locks they have on server files.
Search WWH ::




Custom Search