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.
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:
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 ).
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ā)
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)
Repair and Rebuild (with updating database fields)
Hi @rsp, weāre dealing here of a full custom development.
You can have a custom module with Line Items or you can have custom lines in standard modules like AOS_Quotes or AOS_Invoices.
We want to Add Product line functionality with qty, part number, and description fields in the cases module.
Also, when I download PDF, it should displayed those values.
To add the Product Line functionality youāre looking for (with quantity, part number, and description fields) to the Cases module in SuiteCRM, thereās not an out-of-the-box solution; youāll need to create a custom module that holds the cases details and then relate it to the Cases module. Hereās a step-by-step outline to guide you through the process:
1. Create a Custom Module for Product Lines (Cases Details)
Module Builder or Studio:
Use SuiteCRMās Module Builder (or Studio) to create a new custom module.
Add Custom Fields:
In your new module, add the fields you need:
Quantity: (number/integer or decimal field)
Part Number: (varchar/string field)
Description: (text field)
These fields will store the details for each product line.
2. Establish a Relationship with the Cases Module
Define a One-to-Many Relationship:
In Studio, open the Cases module and create a new relationship to your custom āCases Detailsā module. This establishes that one Case can have multiple product lines.
Configure Subpanel:
Once the relationship is set up, ensure that the āProduct Lines (Cases Details)ā subpanel is enabled on the Cases detail view so that users can add and view product line items related to a Case.
3. Adjust Layouts and Views
Detail View Customization:
Customize the Cases detail view layout (using Studio) to display the subpanel for Product Lines (Cases Details).
Edit View:
If you want inline editing or a custom view for adding product line items directly from the Case edit view, further layout adjustments are needed in the JS part. Check how modules/AOS_Products_Quotes/line_items.js and
modules/AOS_Products_Quotes/Line_Items.php work.
4. Final Steps
Quick Repair and Rebuild:
After making these customizations, run a āQuick Repair and Rebuildā to ensure your changes are applied correctly.
Additional Considerations
Custom Logic Hooks:
If you need to perform additional calculations (like summing quantities or updating totals), you might need to implement logic hooks in the Cases or Product Lines (Cases Details) module.
User Permissions:
Ensure that the appropriate roles and permissions are set so that users can access and modify the new module and its relationship with Cases.