Our standard conventions for this sort of import apply, including (but not limited to):
Everything is case INsensitive; all string comparisons should use InvariantCultureIgnoreCase.
A blank column means “do not touch”. It does NOT mean “blank out” 3) The magic value <BLANK> means “save NULL to this column.” 4) Blank lines above the header row are skipped without error.
Each row of data is processed in a separate transaction.
If one row errors, execution proceeds to the next row.
The Data integrity layer (onchange, post process, validation) is engaged. Validation errors make the row fail.
The target record of each supported table is determined by the value the user supplies in the key fields. For the group table, the key field is GROUP_NAME, for the entry table, the key field can be either ENTRY_ID or ENTRY_CLIENT_CODE.
In ANY case where there is a company level mismatch, fail with an error. For example, if running at the system level and the key fields identify an entry that belongs to a company-tied group, error (regardless of what the user is attempting to do with the entry). Similarly, if a group or entry is identified that actually belongs to a different company, error. If operating at the company level, and system-level records are identified, fail with an error.
When and where appropriate:
If all of the GROUP-related fields are left blank, but some entry-related fields contain data, that means “use whatever group record was identified by the previous row.” If the previous row inserted a new group record, than that qualifies as the “identified” record. Whatever record is used is kept as the identified record in case the next row of data does the same thing.
The same is true if the group-related fields have identical values to the values given in the previous row…that means “don’t change this, just re-use it as the parent for the entry fields in this row.”
If the previous group row errored, then no record can be identified, so if the next row has all-blank group fields, it should also error in that case (but only if identifying a group is actually logically necessary given what the row is doing).