LWA Printing With No Data Record Found Work-Around
Description
When the "Allow printing if record not found" functionality is set, and the user has an invalid database-key value, as well as modified values in the other database-data fields, you can either print the label with an invalid database-key value ONLY, or leave the database-key value blank and print all other database-data fields.
The other option is to open the label, leave the KEY field blank, enter values in the DATA1 and DATA2 fields, and print the label with values showing for DATA1 and DATA2, but nothing in the KEY field. You cannot print a label with all three fields printing if the KEY value is not found in the database.
To Reproduce
As an example, I have a label with a Database-key field called KEY, and Database-Datafields called DATA1 and DATA2.
Here is the database with valid KEY field values of 1, 2, or 3.
However, with the "Allow printing if record not found" Preference turned on, I want to print the label with a Key value of "4", and Data1 and Data2 values as well. If I go into LWA, select that label, and enter "4" in the KEY field, a database lookup happens automatically, which returns the message:
[msg 1602] No records found for primary key field: [KEY] Equal To [4]
With this situation, you have one of two choices;
- You can click on the blank row returned, which will return to the form with nothing in the KEY value.
- You can hit the Cancel button, which will return to the form with nothing in the KEY value.
You can now enter values in the DATA1 and DATA2 fields, but NOT the KEY field. As soon as you enter a value in the KEY field, a database lookup occurs. You cannnot print the label with all three fields populated when the KEY field's value is not in the database.
Solution
The solution is as follows:
- Add an additional column to the database with values equal to the KEY value.
- Add that additional column to the label as a database-data field which is modifiable.
- Use that field to print the label, and make the KEY field non-printable.
Then you can leave the KEY field blank, but add values into the new database data fields, as well as any existing database-data fields, to print the label with all required fields
Article Number
2013070
Versions
LWA 2.4.4
Environment
All supported installation environments.