How to add the lineitems in my custom modules same as the quotes modules

I have a custom module and opportunity module, i need to add the line items in the custom module.
Please help me how to i add the line items.

That is not something easily accomplished. I donā€™t know of any code examples either. Youā€™d have to invent something. Maybe try replicating whatā€™s done in the quotes module.

1 Like

Cool! I didnā€™t see that one! (not sure what version the poster is working in, but that will only work in 7)

Hello

i try to add the line_items in vardefs file of the my module but still the function of the display_lines not called .

ā€˜line_itemsā€™ =>
array(
ā€˜requiredā€™ => false,
ā€˜nameā€™ => ā€˜line_itemsā€™,
ā€˜vnameā€™ => ā€˜LBL_LINE_ITEMSā€™,
ā€˜typeā€™ => ā€˜functionā€™,
ā€˜sourceā€™ => ā€˜non-dbā€™,
ā€˜massupdateā€™ => 0,
ā€˜importableā€™ => ā€˜falseā€™,
ā€˜duplicate_mergeā€™ => ā€˜disabledā€™,
ā€˜duplicate_merge_dom_valueā€™ => 0,
ā€˜auditedā€™ => false,
ā€˜reportableā€™ => false,
ā€˜functionā€™ =>
array(
ā€˜nameā€™ => ā€˜display_linesā€™,
ā€˜returnsā€™ => ā€˜htmlā€™,
ā€˜includeā€™ => ā€˜modules/AOS_Products_Quotes/Line_Items.phpā€™
),
),

my layout shows like that

Does anyone have any idea about the line item issue with the custom module?

Hello

i got the solution for the custom module line item,
We need to change the layout mode of the module from config/services/module/module_routing.yaml
record: false

after this changes we are able to log the line item function in the custom module.