Developing codeunits

From TempusServa wiki
Revision as of 11:10, 25 February 2013 by old>Admin (→‎Different codeunit types)
Jump to navigation Jump to search

Steps for creating a new codeunit

  1. Create a new Java project in your favorite IDE
  2. Import the p2eShared.jar in the project
  3. Create a new class:
    1. The abstract parts are found in: dk.p2e.blanket.codeunit
    2. Implement all abstract methods
    3. Code the method bodies (normally "execute")
  4. Compile and build
  5. Deploy to webservser: [Application]\WEB-INF\lib

After first test of the codeunit a server reboot is needed for each redeployment, as there is no way of removing the loaded classes from memory.

Error handling

Exceptions are handled by themselves using the errorRegistration(Exception e) method.

Different codeunit types

Please read the: Codeunit reference

Most likely you will need to create a Codeunit/Formevents that will allow specific changes for a solution, during views, updates or exports.

Most interactions wil require interaction with the following objects

  • Security
  • Command
  • DbConnection