Calculate total amount based on some condition

Hi all…I want to calculate total amount of field based on select type of one field.
For example i have 1 field scope of work which is having 3 options- Interior, Architecture and Interior + Architecture. i have added depends on permission to all like if i choose scope of work as interior interior amount field will show same for architecture and others.
Now i choose interior and if i fill interior amount i want to fetch that value in total amount and same for architecture scope of work.
If i choose interior+architecture as a scope of work two fields will show interior amt and architecture amt. now i want to add these coloumn total and show into total amount.

i have added ss for reference.
Please Help.
Thank you.

frm.set_value(‘fieldname’, flt(frm.doc.fieldname1 + frm.doc.fieldname2))

1 Like

Thank you…it is working… Can i ask one more question?

I have added a server script where if my probabilty value is in between 0 to 30 the probabilty value will be low and like for medium(30 to 60)and high(60 to 90).

if doc.probability1 >= 0 and doc.probability1 <= 30:
doc.db_set(‘probability_value12’, ‘Low’)
if doc.probability1 > 30 and doc.probability1 <= 60:
doc.db_set(‘probability_value12’, ‘Medium’)
if doc.probability1 > 60 and doc.probability1 <= 100:
doc.db_set(‘probability_value12’, ‘High’)

but for this this error is coming

please guide me.

Please check it.

Thank you for your reply… but still same error is coming.

share your error image

It’s worked on my side.

@SonalD your field type are Data or int/float ?

It was data before…now i have changed it.
Thank you.