For those of you that write LAPI code for Livelink® it can be next to impossible to figure out why things are not working the way they should or what the error you are getting back really means. There is a very simple trick that experienced Livelink® developers use to make the debugging process much easier.
The trick is based on the fact that LAPI is really just a front end for passing information back and forth to the Livelink® engine that is executing Oscript. If you are familiar with the Livelink® Builder you can place break statements on the appropriate LAPI function and then trace through it to see what is getting passed into the function, how Livelink® is processing it and what is being returned to your application.
There are several Ospaces that contain the executable oscript behind the LAPI calls. Most of these begin with "API" such as APIBASE, APICORE, APIDOC, etc. As with general Oscript development the key is being able to find the function you are calling in these Ospaces. Luckily the API functions have the same name as their LAPI calls and the API related Ospaces correspond to a basic set of functionality within Livelink®. For example APIDOC has all the Library or Enterprise functions that deal with object manipulation.
If your LAPI application is calling CreateObjectEx and you need to find out why it is not creating your object you can find the corresponding Oscript function in the APIDOC ospace under the APIDocuments object. We recommend putting a break on the Execute script. When your LAPI code executes the CreateObjectEX call it will pause while it waits for a response from the Livelink® engine. At that point look at your Builder screen and you will notice it is in debug mode at the Execute break point you set. From there you can step through the script execution and see what is passed in from your application, what lines are being executed and what is getting passed back to your application. That should be enough information to resolve the problem.
If you are not familiar with the Livelink® Builder and how to use the debugging facility you should be aware that it takes some practice and familiarity before you can be productive. If you need some specific help with your LAPI application or the Builder you can send email to support@syntergy.com and one of our very experienced developers will help you.
If you have any questions about this Livelink® tip you can send an e-mail to support@syntergy.com or call Syntergy support at (888) 373-7027 or (858) 779-9642. |