JimFoye wrote:
When I first bind a control to a field, that triggers the error:
uiSumpPackerVendor.DataBindings.Add("EditValue", bha, "SumpPackerVendorID");
The thing is, when I implement my workaround, which is nothing more than instantiating the bha entity again, it works fine. It's doing a failed fetch on the new entity that causes problems. But if the fetch fails, why is the entity considered out of synch at that point?
Maybe it's just a philosophical way of looking at things? The entity represents the results of a failed fetch, and so is tainted? In my mind, if the fetch failed, the entity is untouched, and it is as if I never attempted the fetch.
An entity is the data it represents. An entity object is just a container for that data. So an entity which failed to be fetched is nonexistend. You may have a bucket for it, the entity object, but that doesnt' mean the entity is there. So if you read from an entity object and it's out of sync, it means that the entity inside it is out of sync with itself and if there's no entity inside the entity object, that also means it's out of sync with itself, as it wasn't loaded properly or initialized.
If you really REALLY need to work around this, you can set the entity.fields.State to new or fetched, though if you set it to fetched, you suggest the entity is there while it isn't.