UI field to display calculated value

I need to display a calculated value, that look like any other readonly Data field.
On form’s refresh, I call backend method to get the calculated value.
I do not need to save this value in the doctype’s database table.

I could use a Data docfield, but then it creates an useless column in the database. Moreover, when I call frm.set_value() it triggers dirty() on the form.

I could use an HTML docfield, but then I need to duplicate a load of html to replicate the look of a Data field (label and input).

Any other suggestions ?

This is what you are looking for Virtual DocField

1 Like