Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Database connection in Startup method
Douglas_Richardson_(drichard_(Delete)_3245824)
When Startup is called by Livelink when the system starts, is there a database connection available that I can use to initialize my objects?In the following function I want to get rid of the prgCtx argument. To do that, I need to initialize fURLPrefix in the Startup function.function String URLPrefix(Object prgCtx) if .fURLPrefix == '' CAPILOGIN login = prgCtx.fDbConnect.fLogin Dynamic dbResult = CAPI.IniGet(login, 'Livelink.WebInfo', 'URL') .fURLPrefix = dbResult[1] end return .fURLPrefixend
Find more posts tagged with
Comments
Donna Nalls
Hi Douglas,Attached is a little code snippet that will create an Admin prgSession for you. I have never used it in root.startup(), but can't think of a reason why it won't work.add this as a script in your root object - name it "su", then call it from your startup method:dynamic tmpPrgCtx = .su() after you run your updates, you may want to delete this session:tmpPrgCtx.delete() Regards,Donna