Line Items in a Custom Module

Hi,
how can I reproduce Line Items like in Quotes mdoule in a custom module?
I see in custo/module/Aos_Quotes where is definied the field but i try to make similar in filed of a custom module but i donā€™t see nothing
I know how customize javascript code but I think I miss one step for visualize in edit view and detail view.

HELP

DONE!!!

Please post itā€¦It could be useful for others

2 Likes

How? :slight_smile:

Please share your solution, thank you so much

All your customize or edit or duplicates in Developer Tools / STUDIO (Customize module fields, layouts and relationships)

Dear SuiteCRM community,

I created the custom module Lieferscheine (delivery notes). The basis is the contract. Workflow: quote -> contract -> delivery notes (Lieferscheine). To create the delivery notes (Lieferscheine) I use createContract.php, in the contract module.
All data are transferred correctly, except the ā€œline itemsā€. These are neither displayed in detailview nor in editview. Only this is shown in editview:

But when a delivery note is printed in a PDF, all datas are displayed, includ the ā€œline itemsā€.

What did I make wrong? What I have to do, so that I can edit the positions in the editview?

Does it have to do with realationship ?:

Can someone help me, please. I would be very happy about it

  1. In a custom module in modules/modulename/vardefs.php file and localization file (/en-us.lang.php) define the fields and relationships (AOS_Products_Quotes and AOS_Line_Item_Groups):
    ā€˜LBL_IMPORT_LINE_ITEMSā€™
    ā€˜LBL_LINE_ITEMSā€™
    ā€˜LBL_GRAND_TOTALā€™
    ā€˜LBL_TOTAL_AMTā€™
    ā€˜LBL_TAX_AMOUNTā€™
    ā€˜LBL_SUBTOTAL_AMOUNTā€™
    ā€˜LBL_SHIPPING_AMOUNTā€™
    ā€˜LBL_SHIPPING_TAX_AMTā€™
    ā€˜LBL_DISCOUNT_AMOUNTā€™
    ā€˜LBL_ADD_PRODUCT_LINEā€™
    ā€˜LBL_ADD_SERVICE_LINEā€™
    ā€˜LBL_REMOVE_PRODUCT_LINEā€™
    ā€˜LBL_SERVICE_NAMEā€™
    ā€˜LBL_SERVICE_LIST_PRICEā€™
    ā€˜LBL_SERVICE_PRICEā€™
    ā€˜LBL_SERVICE_DISCOUNTā€™
    ā€˜LBL_VAT_AMTā€™
    ā€˜LBL_TOTAL_PRICEā€™
    ā€˜LBL_PRODUCT_QUANITYā€™
    ā€˜LBL_PRODUCT_NAMEā€™
    ā€˜LBL_PART_NUMBERā€™
    ā€˜LBL_PRODUCT_NOTEā€™
    ā€˜LBL_PRODUCT_DESCRIPTIONā€™
    ā€˜LBL_LIST_PRICEā€™
    ā€˜LBL_DISCOUNT_AMTā€™
    ā€˜LBL_UNIT_PRICEā€™
    ā€˜LNK_LISTā€™


My custom module name: acts_company_acts
This fields and relationships copy from AOS Invoices (vardefs.php) (By changing the name of the module to yours ).

  1. Copy from AOS_Invoices.php function ( public function save($check_notify = false)) to you custom module main class (my class ā€œacts_company_acts extends Basicā€)

  2. Copy PANNEL settings edit view, detail view and panel view from AOS_Invoices to (custom/modules/custommodules/metadata/editviewdefs.php, custom/modules/custommodules/metadata/detailviewdefs.php)

  3. Repair and Rebuild (with updating database fields)

Everything should work.

1 Like

Hi @Ankita14, please note that the Line Item section is a custom fuction field

Thankyou but i have found out the solution and now i can get the complete functionality of line items in my custom module

Youā€™re welcome.
If you want you could share it here, it would be a good idea for the Show and Tell - SuiteCRM section

Please share the code, it could be useful for lot of people.

Hi @Ankita14
I am also looking for the same. Would you kindly share