This commit is contained in:
2022-03-27 19:38:40 +00:00
parent 97c5fba986
commit 795f9ae94b
2 changed files with 23 additions and 17 deletions

View File

@@ -2,7 +2,7 @@
The Import form is used to import new records _or_ update existing records in AyaNova from a local import file.
More advanced import or synchronization requirements are also possible through the [AyaNova developers API](api-intro.md).
More advanced import or synchronization requirements are supported through the [AyaNova developers API](api-intro.md).
## Authorization Roles required
@@ -24,13 +24,15 @@ From the `Administration` navigation pane select `Import` navigation item.
Checkmarking "Import new records" indicates you want to **import** unmatched records into AyaNova.
AyaNova will attempt to match the import records to existing records in the AyaNova database by comparing the "key" field (identified in each objects [import specifications](#import-specifications)).
AyaNova will attempt to match the import records to existing records in the AyaNova database by comparing the unique key field identified in each objects [import specifications](#import-specifications).
Usually the key field will be the `Name` field but in some cases it may be another field that is the primary unique identifier for that record type.
The key field must match exactly, case and spelling matter.
The key field must match exactly; case and spelling matter.
If no existing record matches the key field then that record will be submitted to the business object `create` handler for validation and saving. This is the exact same process used when you manually edit and save a form in AyaNova which ensures all business and validation rules are checked.
If no existing record matches the key field then that record will be submitted to the business object type's `create` handler for validation and saving.
This is the exact same process used when you manually edit and save a form in AyaNova which ensures all business and validation rules are checked.
If no errors are found then the record is saved into the database and a success message is added to the results list displayed in the Import form once import has completed.
@@ -44,41 +46,47 @@ The time stamp is created at the AyaNova server from the server's time zone so i
The Tag format is `zz-import-yyyyMMddHHmmss` for example `zz-import-20220619114532` indicating a record imported June 19th 2022 at 11:45am and 32 seconds.
The zz is prepended to ensure it displays last in the list of existing tags so it won't get in the way.
The `zz` is prepended so that the import tag displays last in the list of existing tags.
You can easily remove the tag later if desired by using the [bulk tagger extension](ay-ex-tags.md) with the delete option.
You can easily remove the tag later if desired by using the [bulk tagger extension](ay-ex-tags.md) delete tag option.
## How update works
Checkmarking "Update existing records" indicates you want to **update** matched records in AyaNova.
AyaNova will attempt to match the records in the import file to existing records in the AyaNova database by comparing the "key" field (identified in each objects [import specifications](#import-specifications)).
AyaNova will attempt to match the records in the import file to existing records in the AyaNova database by comparing the unique key field identified in each objects [import specifications](#import-specifications).
Usually the key field will be the `Name` field but in some cases it may be another field that is the primary unique identifier for that record type.
The key field must match exactly, case and spelling matter.
The key field must match exactly; case and spelling matter.
If an existing record matches the key field then that record will be submitted to the business object `update` handler for updating then validation and saving. This is the exact same process used when you manually edit and save a form in AyaNova which ensures all business and validation rules are checked.
If an existing record matches the key field then that record will be submitted to the business object type's `update` handler for updating then validation and saving.
All the fields provided in the import file will be used to replace the matching fields in the current business object in the database.
This is the exact same process used when you manually edit and save a form in AyaNova which ensures all business and validation rules are checked.
All the field data provided in the import file will overwrite the matching field's current value in the database.
The key (usually `Name`) field can not be updated as it's used to match records.
Unlike the import process, updated records are _not_ automatically tagged however you can still see which records were updated if necessary via the [history feature](ay-history.md).
Unlike the import process, updated records are _not_ automatically tagged (there is no simple way to undo an update) however you can still see which records were updated if necessary by viewing the personal history of the User doing the update via their [history feature](ay-history.md).
### Partial record updates
You may want to only partially update existing records in specific fields.
There is often a need to only **partially** update existing records in **specific** fields.
AyaNova supports this by convention: only include fields you want updated.
AyaNova supports this by convention: only include fields in the import file that you want updated.
Any fields that should remain untouched must **not** be included in the import file.
For example if you wanted to only update email addresses in Customers you would provide only the key field for matching (`Name`) and the `EmailAddress` fields in the import file.
For example if the requirement is to only update email addresses in Customers and leave all other fields unchanged, you would provide only the key field for matching (`Name`) and the `EmailAddress` fields in the import file.
All included fields are overwritten, so an empty or null field value in the import file will overwrite (remove) any data in the matching field in the existing record.
## Import files
### Undoing an update
The only way to undo an update is to [restore the database](ops-restore.md) from a backup.
## Files
### File types supported

View File

@@ -46,8 +46,6 @@ Be sure to include the quotation marks exactly as written.
PostgreSQL will display `database system is ready to accept connections` indicating it's up and running and ready for restore. Do not stop PostgreSQL until directed to do so after restore below.
###
### Make a copy of the AyaNova server's data folder
If there is any existing data then a file system copy of any existing AyaNova server's [data folders](ops-config-data-path.md) to a safe location should be done first as a precaution.