Wednesday, November 4, 2009

How to create Treeview layout in Navision

We have known that treeview layout can be found in Chart of Account overview form. I try to learn the logic and how it works to create treeview layout. Therefore, I create a table and a form to test it.

The important thing that in table must has : No, Name, Type(Heading, Begin-Total, Posting, End-Total, Total), Indentation, and Totaling field.


For Creating treeview form from the table, we just follow the logic from Chart of Account Overview form. I think it's quite simple to do that. First, we create 7 functions :

  1. InitTempTable (send parameter(Yes/No) to CopyCountryToTemp function)
  2. ExpandAll (to expand all)
  3. CopyCountryToTemp (Insert table data to temporary table)
  4. GetEndTotal (get Totaling data from "End-Total" to "Begin-Tota"
  5. HasChildren (Check whether has children or not)
  6. IsExpanded (Check whether has already expanded or not)
  7. ToggleExpandCollapse (toggle for expand and collapse)
Second, add codes in OnFindRecord, OnNextRecord, and OnAfterGetRecord event


Result:




No comments:

Post a Comment