cancel
Showing results for 
Search instead for 
Did you mean: 

Questions about Conten Model

heavyvinicio
Champ in-the-making
Champ in-the-making
hi, how I can calculate the sum of items entered in several fields within a defined panel in a content model automatically????

What options do I have??

What I do is:
field1: 25.00
field2: 50.00
field3: 100.00

Total: 175.00 -> This is the value I want is calculated automatically

Please have any ideas?

Thank you.
2 REPLIES 2

ecarbenay
Star Contributor
Star Contributor
Hi,

a way to proceed may be to add a rule to be applied when creating and when updating the documents, in order to calculate the result given the fields values.
This proposal assumes that the content model defines field1, field2 and field3, and total as properties for each document (an invoice with amount and vat given by user, and total automatically calculated)

Does that help ?

kaynezhang
World-Class Innovator
World-Class Innovator
Or you can register behaviour for your content type.The behaviour calculate value for the total  property.Your behaviour should implements NodeServicePolicies.OnUpdatePropertiesPolicy and NodeServicePolicies.OnUpdateNodePolicy and so on.