To work with M4 Back Office on existing data only the standard columns have to be added to a table. If you want to use the same tables in M4 Back Office and other applications default values for standard columns can bes defined.
Include Tables
To include existing tables you only have to set the table name to the name of the existing table and to choose Create Tables(s) And Columns.... The M4 standard columns M4ID, M4Date and M4User are created with the following values:
- M4ID: New GUID
- M4Date: System date
- M4User: NonM4User
If you want to keep working on these tables with other applications you need to select Yes from the IsEditedOutsideM4Setting property.
On the next creation of database objects, default values are defined, that are used if the table is edited outside of M4 Back Office.
ID Fields
ID fields are GUID fields used to join parent and child tables. Each IDField joins to the M4ID of its parent table. The field name of ID fields is always [ParentTableName]M4ID. To update an IDField in existing data with the M4ID of its parent table the key column or columns used outside of M4 Back Office need to be specified. To do this right click an IDField and choose Update ID Field Edited Outside Of M4 Back Office....
Define one or more key column pairs and select Start Update.
If you want edit the parent/child table combination outside of M4 Back Office in the future, a trigger can be set to maintain the IDField if new records are added or the values of the existing key column are changed. Select Create Trigger.
Triggers for inserts (identifier ending with I) and updates (identifier ending with U) are created.
If you select the tab SQL, you can also review, copy and execute manually the scripts used for update and trigger creation.