Facebooktwittergoogle_plusredditpinterestlinkedin

Hi Everyone,

The purpose of this post is to help you understand some of the mystery behind ADempiere and iDempiere tree management. Here are some quick bullets:

  1. All trees except Product are held in the AD_TreeNode. Products are held in AD_TreeNodePR table.
  2. The ‘Tree’ window defines AD_Tree_ID.
  3. Inside the AD_TreeNode Table
    1. The Node_ID is the record ID of the tree’s child record.
    2. The Parent_ID is the record ID of the tree’s parent record. Parent records must have the ‘summary’ flag is set to ‘Y’

Trees are used extensively in ADempiere and iDempiere. They are used to manage and organize business partners, charts of accounts, products, roles, menus, financial entities, projects, campaigns, and departments.

Here are some examples of how you can manipulate records at the database using the tree structure:

Example #1: Move fertilizer org inside the store summary org.

UPDATE AD_TreeNode SET Parent_ID=50007, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=104 AND Node_ID=50001;

Example #2: Move all not needed GL Accounts (in the Account Element window) to a folder called ‘DeleteMe’; then, create a SQL statement to delete the not needed accounts.

delete from C_ElementValue 
where C_ElementValue_ID in 
(
 select node_id
 from ad_treenode 
 where parent_id = 1000489 -- record_id of parent folder
 and ad_tree_id = 1000008 -- name of the Account Element tree
) or C_ElementValue_ID=1000489 -- record_id of the parent folder
;

 

About Chuck Boecking: I am an ERP educator. I believe that open source ERP have achieved mainstream capabilities, and as a result, more companies can create greater efficiency across their organization. I started using the iDempiere code base in 2003. Back then, it was called Compiere. In 2006, I started my first multi-million dollar installation. Since then, ADempiere has helped me create great success with distribution and manufacturing companies all over the world. My vision of success is to find companies that can best use open source ERP to help them achieve a single, global instance that drives a discontinuous increase in profitability. I believe that organizations win when they own their technology.

If you have questions, comments or concerns, let me know. I definitely want your feedback.

You can contact me by phone using 512.850.6068.

My email is chuck@chuboe.com.

You can complete the form on this page.

Thank you for taking the time. I look forward to speaking with you.

Regards,
Chuck Boecking
http://www.linkedin.com/pub/chuck-boecking/10/970/17b

 

Facebooktwittergoogle_plusredditpinterestlinkedin

Leave a Reply

Your email address will not be published. Required fields are marked *