Regarding code architecture / Locating coding file / Reading Code

93 views
Skip to first unread message

Nishant Goswami

unread,
Mar 12, 2016, 9:45:30 AM3/12/16
to iDempiere
Hello Group,
Greetings
I want to insert sales order data in to idempiere database through code. Where can i found the code which take care for inserting sales order data? Because i want to do customization during insert.

For example, when we save the sales order details in idempiere and data will save in to sales order table.
So, i want to know how to locate that insert code in the source code. Do you know where can i found it? or any Documentation related to that?
Thank you

Anozi Mada

unread,
Mar 12, 2016, 8:16:44 PM3/12/16
to iDempiere
Hi Nishant Goswami,

First you need to know the table name. Generally in any window in iDempiere you can click the record info to know the table name of that tab (see image)

After you know the table name, you can find the java model class name by removing the prefix and adding "M" in the front. So C_OrderLine become MOrderLine, M_InOut become MInOut, C_BPartner become MBPartner, etc. You can find the class in eclipse using shortcut Ctrl+Shift+T.
You can check method beforeSave and afterSave of that model class if you want to know what the system doing when user insert a record (note the newRecord flag). Also you can check class PO (Persistent Object) to study more about how system save the data to database.
But if you want to do customization you don't want to change the model class directly. For that customization you can use Model Validator.
You can study more about Model Validator in the references below.
http://wiki.idempiere.org/en/Developing_Plug-Ins_-_ModelValidator
https://www.youtube.com/watch?v=Dwjl8p1Xguw

Hope this answer your question

Regards,
Anozi Mada
Auto Generated Inline Image 1

Nishant Goswami

unread,
Mar 13, 2016, 4:36:54 AM3/13/16
to iDempiere
Thank you Anozi Mada,
Reply all
Reply to author
Forward
0 new messages