order wrongly showing changes have been made

Discussions related to custom development with Select.
Post Reply
dfrandsen
Posts: 15
Joined: Tue Mar 03, 2009 11:33 am

order wrongly showing changes have been made

Post by dfrandsen »

We've built a custom package that keeps track of changes to certain fields within the SoftPro client. Basically, we attach to the IWindowManager.ActiveDocumentChange event and then examine the loaded order whenever the user moves to a different order.

After installing the package, we find that as soon as the user accesses the order, it gets marked as "dirty" (the asterix appears in the order tab as though changes were made). This happens even when no changes have been made, therefore users are confused when they are prompted to save changes when they try to close the window.

I've gone through the code in my package and through the process of elimination have found the problem happens when I do this:

Code: Select all

foreach (var ln in order.Loan)
where "order" is the current IOrder object. It doesn't matter what I do inside the loop - in fact I tried commenting out everything so that there is just an empty loop, but it still marks the order as dirty.

Why would reading through the Loan collection be interpreted as a change to the order?
Mark McKenna

Re: order wrongly showing changes have been made

Post by Mark McKenna »

Unfortunately, that can occur because of the way our business rules engine currently operates. When a piece of data is requested, either programmatically or through data binding, it "pulls" information until all of its inputs are fulfilled and it can generate the value. As these fulfillments work their way through the model, other rules often run that generate new values, new objects, or even new collections. There must be something in the fulfillment chain when retrieving the loan collection that is tricking the engine into thinking that the order has really changed. Select is currently undergoing an update to its rules engine that should address this shortcoming.
Post Reply