Creating some more advanced Maintain Table Screens
Objective / Overview
openPETRA contains many screens which set up data that is used all over the application and which can be customised to address the specific situation of an office or organisation. These screens are called 'Maintain Table Screens' and the objective of this Project is to create such screens. A Maintain Table screen allows CRUD (Create, Read, Update, Delete [1]) operations for a specific system table/lookup table of openPETRA.
The creation of Maintain Table Screens involves quite a few manual steps, but there is hardly any source code that needs to be written because the openPETRA WinForms Generator generates >95% of the code!
Example:
There is another Project which involves the creation of simpler Maintain Table screens.
Desired Outcome
Adding a few Maintain Table screens to openPETRA and in the course of doing that
- learning about the client-side project structure
- learning about our screen definition files (YAML files)
- getting to know the openPETRA database structure documentation
- getting to know the WinForms Generator
Solution
Follow the steps on the How-To: Creating a Maintain Table screen wiki page for each of the screens.
Finding DB Tables Definitions
The definitions for the openPETRA DB Tables which are used in the screens can be found here.
Scope: Maintain Table Screens List
The screens below are for different Modules of openPETRA.
Note: The column 'Complexity' is not of importance to you, but it is important for the openPETRA team who needs to see those screens in the context of the other Maintain Table screens (there are 115 of them...).
Partner Module
Screen Name | Complexity | Database Table | CacheableDataTable | Comment |
---|---|---|---|---|
Publication Cost | 2 | p_publication_cost | PublicationCostList | (*2) (*7) (*A1) (*A2) |
Mailings | 2 | p_mailing | N/A (*1) | (*2) (*8) (*A3) (*A4) |
For the Mailings screen, don't put the DB fields a_motivation_group_code_c and a_motivation_detail_code_c on the screen.
Finance Module
Screen Name | Complexity | Database Table | CacheableDataTable | Comment |
---|---|---|---|---|
Corporate Exchange Rate | 3 | a_corporate_exchange_rate | N/A (*1) | (*4) (*A5) (*A6) (*A7) (*A8) |
Method of Giving | 2 | a_method_of_giving | MethodOfGivingList | (*4) (*A9) |
These two screens go in the 'Finance Module Setup' area of the Finance Module menu. Please put the screen 'Corporate Exchange Rate' under the 'GL Setup' heading and the screen 'Method of Giving' under the 'Gift Setup' heading.
Personnel Module
TODO
Screen Name | Complexity | Database Table | CacheableDataTable | Comment |
---|
Key to Comments
- TODO
Dealing With Errors When Saving Data
If you find that you get an error message when trying to save changed data in any Maintain Table Screen, have a look in the Client Log file to see the actual exception (at the very end of the file). The most common cause of getting a problem at that point is that a certain field that is specified in the DB is not on the screen, and that DB field has the Constraint 'NOT NULL'. This will prevent saving, as openPETRA doesn't assign anything, not even NULL automatically to such fields, since they are not on the screen. The solution for that is to have a Method called 'GetDetailDataFromControlsManual
' in the ManualCode.cs file. You can find an example implementation for it in the file U:\openpetraorg\csharp\ICT\Petra\Client\lib\MPersonnel\gui\setup\AbilityAreaSetup.ManualCode.cs.
If this is not applicable or still doesn't solve the problem of not being able to save changed data, ask ChristianK, who should be able to help you.
Approval of Functionality and Program Code
TODO