How can add custom field save into database?

I am new with suiteCRM. I have configured suiteCRM 7.9.12. I have need to customise line item in Quote section.
I have edited “/custom/modules/AOS_Products_Quotes/line_items.js” and it effected my edit view.

But when I add my custom field into it, they are display on view but, not know, how to store these custom field in our database?

please help me for these customisation…

I am not sure about the answer because Line items is a very specific part of the code, it has unique functionality.

But if you search for the metadata files driving that screen, you can probably find the other fields and add yours there. There are probably some vardefs.php or similar files describing the connection between the screen and the database.

But I am not understand, how can I store custom field data into database… :frowning:

You didn’t add the field like you should have. If you add it only on the screen level, then it has no connection to the database.

See the field definitions here

Of course, you’ll have to study some examples on the Internet about how to add fields to vardefs. You can start here

Now I have add custom field from studio and put same name field in line_items.js.

data are saved into database but when in edit mode the custom field value are not set…

what I need to do now?

I am sorry but I can’t help you with a specific answer, I don’t know.

You should try setting up XDEBUG and an IDE so you can step through the code and follow the values of the variables. You should be able to replicate what is being done with the other fields, for your custom field. But it is complex (as you have found out, by now). Good luck.

I was struggling with this too and found out it’s way easier than you think!

Just go to Admin, scroll down and click on Studio, then click on Products, and from there click on Fields to add fields and then back to Studio>Products and click on Layouts and add the fields to your Edit View, List View, etc.

Good Luck!

@tberneman that’s ok for generic fields in Products, but can you make those new fields appear when creating a Quote, in the Line Items section?

Of great importance is how you name the field, in the picture is my example of adding an custom field to the headings and it is saved in the database

in Database

1 Like