Plataan - Microsoft Dynamics - Learning & Competence Management Vincent Bellefroid Koen Stox Steven Renders Conny Schuddinck Steffie Alexiou
A blog about Microsoft Dynamics
Home Archives Subscribe Plataan website

« Confused by WIP? Not anymore! | Main | You do not have permission to delete the MBS MenuSuite object. »

21/10/2008

Be careful with Editable SumIndexFields!

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.

Comments

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.

The comments to this entry are closed.

October 2011

Mon Tue Wed Thu Fri Sat Sun
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Plataan Community

Visit us on LinkedIn Visit us on Facebook Visit us on Twitter