When you define a SumIndexField on a table, sometimes people forget to make the field Not Editable. As a consequence, on forms where the SIFT is shown, the user has the possibility to write something into a SIFT field.
What happens in this case and why is this 'dangerous'?
Let's take as an example the Cronus Demo Database, Dynamics NAV 5.1. (Native) In the Customer table (18) there's a field called: "Balance (LCY)". This field displays, in LCY, the customer's current balance. Dynamics NAV automatically calculates and updates the contents of the field using the entries in the Amount (LCY) field in the "Detailed Cust. Ledger Entry table".
When you take the Customer table into design, you can see this calculation in the Calculation Formula of the FlowField:
Now, just for fun, let's make the FlowField Editable:
Ok, now go to the Customer Card and open customer 60000:
Our Balance (LCY) field has now become an editable field. When you click on the Drilldown this is shown:
Now, enter 100 in the Balance (LCY) field:
When we click on the Drilldown, the list is still empty:
But, when you open the "Detailled Cust. Ledg. Entry" table:
You immediately notice that a line was added here, containing only an "Entry No.", "Customer No." and an "Amount (LCY)"!
This is because the FlowField was editable, and for the newly entered total of 100 to be correct, Dynamics NAV went into the underlying table and created an entry on its own…
This is why it is strongly advised to make FlowFields NOT Editable when showing them on Forms.
There are cases when this ability is fantastic. Such as budgets and other types of data that you don't have to post. The user can update the value and the underlying table generates an audit of the changes.
I agree with not allowing edits when the edit would cause integrity problems as you illustrated.
Posted by: Django Dunn | 23/10/2008 at 14:29