PdcDatabase.CreateUserTable: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
<br />
<br />
The FieldData parameter is the most important and complex parameter in this method. It consists of 7 elements, separated by ~.<br />
The FieldData parameter is the most important and complex parameter in this method. It consists of 7 elements, separated by ~.<br />
* Field Name<br />
* Field Name:<br />
:text value, cannot be empty, cannot exist in UF_FIELDNAME or VELDNAAM.<br />
:text value, cannot be empty, cannot exist in UF_FIELDNAME or VELDNAAM.<br />
* Field Description<br />
* Field Description:<br />
: text value<br />
: text value. This text will be stored in the long fieldname in the user's language in the VELDNAAM table.<br />
* Field Type: <br />
* Field Type: <br />
: TEXT: Length >0, number of decimals = 0 and the length of the default value <= length <br />
: TEXT: Length >0, number of decimals = 0 and the length of the default value <= length.<br />
: CHOICE: text value, length >0, number of decimals = 0, and the length of the default value <= length, choices are separated by #. If a default value is provided it needs to exists in the list of choices.<br />
: CHOICE: text value, length >0, number of decimals = 0, and the length of the default value <= length, choices are separated by #. If a default value is provided it needs to exists in the list of choices.<br />
: NUMERIC: fieldlength = 0, number of decimals <+ 00, if a default value is provided it needs to be numeric.<br />
: NUMERIC: fieldlength = 0, number of decimals <= 99, if a default value is provided it needs to be numeric.<br />
: CURRENCY: fieldlength = 0, number of decimals <+ 00, if a default value is provided it needs to be numeric.<br />
: CURRENCY: fieldlength = 0, number of decimals <= 99, if a default value is provided it needs to be numeric.<br />
: DATE: fieldlength = 0, number of decimals = 0, default value is emtpy.<br />
: YESNO: fieldlength = 0, number of decimals = 0, default value is empty (will be created as false), FALSE, TRUE.<br />
: MEMO: fieldlength = 0, number of decimals = 0, default value is emtpy.<br />
: TIMESTAMP: fieldlength = 0, number of decimals = 0, default value is emtpy.<br />
* Field length:<br />
: see specifics per field type above.<br />
* Default value:<br />
: see specifics per field type above.<br />
* Number of decimals:<br />
: see specifics per field type above.<br />
* Choices:<br />
: text value, separated by #.<br />
 





Revision as of 11:53, 9 February 2016

Declaration

CreateUserTable(TableName: String, TableDescription: String, FieldData: String) as boolean

Description

Using this method you can create a usertable inclusive all fields without any reorganization of the database.
This is only possible if the table doesn't exist already. To determine this use the method 'UserTableExists'.


The FieldData parameter is the most important and complex parameter in this method. It consists of 7 elements, separated by ~.

  • Field Name:
text value, cannot be empty, cannot exist in UF_FIELDNAME or VELDNAAM.
  • Field Description:
text value. This text will be stored in the long fieldname in the user's language in the VELDNAAM table.
  • Field Type:
TEXT: Length >0, number of decimals = 0 and the length of the default value <= length.
CHOICE: text value, length >0, number of decimals = 0, and the length of the default value <= length, choices are separated by #. If a default value is provided it needs to exists in the list of choices.
NUMERIC: fieldlength = 0, number of decimals <= 99, if a default value is provided it needs to be numeric.
CURRENCY: fieldlength = 0, number of decimals <= 99, if a default value is provided it needs to be numeric.
DATE: fieldlength = 0, number of decimals = 0, default value is emtpy.
YESNO: fieldlength = 0, number of decimals = 0, default value is empty (will be created as false), FALSE, TRUE.
MEMO: fieldlength = 0, number of decimals = 0, default value is emtpy.
TIMESTAMP: fieldlength = 0, number of decimals = 0, default value is emtpy.
  • Field length:
see specifics per field type above.
  • Default value:
see specifics per field type above.
  • Number of decimals:
see specifics per field type above.
  • Choices:
text value, separated by #.



Notes

After creating a table with this method, you have to restart PdC, to have the new table shown in the menu of PdC.

Code example

Availability

Available since 11-12-2015 (from version 5.1 onwards)