Hi! A form has the field CoName which is a dialog list that is populated using @DbColumn. (The companies’ names located in a different database.) When the company is selected, the address field (text, computed) is automatically populated. The document is then saved. The problem arises when the company name is changed in the other database, and this document is opened and re-saved. The error “Field: ‘address’: File does not exist” shows up, and the document cannot be opened. My users aren’t sure if they want to keep the original information in the document, or update it to reflect the current changes. Any ideas as to how we can correct this problem? As I am new to this, all suggestions/ideas will be greatly appreciated. Thanks in advance!
Subject: Problem With @DbColumn
in your computed text field, use an if statement to make it only calculate if the field is blank:
@If(Address = “”; @DbColumn; Address)
Now what if the user goes and changes the CoName field value? Well you will need to do some coding to check if that field changes and if so, recalculate the Address field.
Subject: RE: Problem With @DbColumn
Thanks, Paul.
Subject: Problem With @DbColumn
You need to link the two documents with a value that will not change.
On your Company form, put a hidden field, computed when composed, with the formula @Unique
That will give all documents a unique static “key” that will never change.
You’ll need to run an agent to add that key to all existing documents.
In your main database, continue to look up the company name as you do today.
Once the user selects one, get it’s key, and store that in a hidden field.
Then change your address lookup to use the key instead of the company name.
You will need to run an agent to populate the keys for existing documents.
As an additional exercise, determine a way to look up the company name as well when documents are edited, so that it picks up any name changes.
Subject: RE: Problem With @DbColumn
Thanks, Graham! We’re working on the name change scenario now.