Custom Field on Grid

Hello,

I`m created the below custom new field.

I`m able to see it on grid and choose the value from dropdown list but uppon submit, the value is dissapearing. If i Edit the record and choose the value from edit form and then save, the value is still appeared on grid normally.

Appreciated for any help.

Hello! Did you change the model as well??

On the model I just add new field « PaidWith »

Because manyToOne the field is supposed to point to another model (for paid it)
In the model it shows Integer.
I am not sure it is correct.

I`m also trying with Type « String » but same result

Below is the Selection « hr.expense.company.cb.paidwith ».

If I enable the Extension mode on View then there is a popup window that allow me to choose the PaidWith options but the problem is when i add line it is not diplayed in expense header

If there is an option to have Extension mode enabled and grid lines appeared, would be perfect :slight_smile:

1 « J'aime »

I think your problem is the type.
Your type should be paidwith instead string
Try

It doesn`t let me use Type « paidwith »

It allow only the below types

1 « J'aime »

In this case select. OneToMany or ManyToOne accordingly

I tried both but can`t get it work

After save it`s still null value on grid

image

image

Is it possible to have Grid lines appeared after Extension Mode for expense-line-grid is enabled? Because after i submit the form with extension mode enabled i can`t see the lines with manager/user account.

Does the data appear in DB? I want to know if is it just a presentation issue, or if the data is stored as NULL

The data is stored as NULL on the database (from grid)

From the Form the data is stored normally.

Thanks in advance.

Is there any way to store data to database from custom field on grid lines?

I created several custom fields in different grids.
How do you add options (CASH etc.?)?
Let me try to find some example to show you

I`m doing the below steps. You can check my example on https://demo.axelor.com/open-suite-en (ERP)

  1. Create the below Selection

  2. Create the below Custom Field using the above Selection with the following settings

  3. Create a new Expense with the following grid line field

  4. When Confirm, the value on « test » field is missing

The same thing happens on my build. I`ve tried different Types on Custom Field Type like ManyToOne, Boolean etc. but no success.

Hi You can see I used a Select Custom Field as recurrence.
To add in Employee contract ax extra payment with a recurrence (Daily Weekly Monthly etc.)




Hope it helps

Maybe the error is inside the model how you configured it

Can you send me a photo of Custom Field also please?

I didn’t added it as custom field.
I just changed code…

I didn`t find any solution yet :confused: I think i have to use OnChange with action but i dont know how. Can someone help please? :slight_smile:

Hello
Sorry to hear it doesn’t work, did you try to edit the model instead using a custom field just using an extra field?
I can send you another example.
I used GENDER FIELD for Employee (Select)

Hello fabiobottan,

Yes I tried to edit model also instead of creating custom field but it didn`t works. What I did so far:

  1. I created new field PaidWith on model ExpenseLine

  2. On expense-line-grid View I add the field PaidWith

  3. On database also I created new field PaidWith

If I input data on field PaidWith from the grid, it is not saved on the database. How can I connect the database field PaidWith with the model field PaidWith?

Really appreciate for your help!