跳至内容
菜单
此问题已终结

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

形象
丢弃
最佳答案

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. ]

形象
丢弃
最佳答案

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.

形象
丢弃
相关帖文 回复 查看 活动
1
3月 15
4185
1
1月 17
4969
2
3月 24
2353
3
8月 15
5056
4
9月 24
21225