Skip to Content
Menu
This question has been flagged

Hello,

Data of computed field is not storing in database . Is there any particular reason for making computed field so ?

What is the benefit of not storing value of computed field in database ? Can anyone explain it in detail ? Please give a complete explanation. 


Thanks & Regards

Avatar
Discard
Best Answer

Hello

 [ By default, a computed field is not stored to the database, and is

computed on-the-fly. Adding the attribute ``store=True`` will store the

field's values in the database. The advantage of a stored field is that

searching on that field is done by the database itself. The disadvantage

is that it requires database updates when the field must be recomputed. ]

Avatar
Discard
Best Answer

Hi Nikesh,

We use computed fields, if the value of field is computed using some logic and depends on other fields. For example: Total in Sale order is computed from sum of line subtotal

Computed field compute its value every time we access its value instead of reading from database.

By default, a computed field is not stored to the database, and is computed on-the-fly. Adding the attribute store=True will store the field's values in the database. The advantage of a stored field is that searching on that field is done by the database itself. The disadvantage is that it requires database updates when the field must be recomputed.

For more please check Link


Hope this helps.

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 15
3353
1
Jan 17
3873
2
Mar 24
900
3
Aug 15
4296
4
Sep 24
19428