Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Drop-down lists Form Calc

Avatar

Former Community Member

Hi,

I am new to Livecycle and am currently updating administration forms to make them interactive. I am having trouble with FormCalc for the expenses form. There are columns for kilometres, rate (drop-down list) and total. Basically I want 'kilometres' x 'rate' to equal 'total'. I can total the kilometres x rate easily if they are both numerical boxes, but once the rate column becomes a drop-down list with three different value options, it will not calculate for me. Do I have to change the formula for drop-down lists?

Thank you!

Kate

4 Replies

Avatar

Former Community Member

This would be easier if we could see your form in context. Can you post it?

Paul

Avatar

Former Community Member

No problems, please see the attached form.

Thanks Paul!

Avatar

Former Community Member

The issue is the $ sign in the dropdown. By adding the $ sign you are making this a string and not a number. To fix this you can do it in one of two ways. You can remove the dollar sign or you can leave the dolloar sign in plcae and take advantage of how Dropdowns work. You can have a specific value shown (this is the Displayed Value) but then have a completely different value used when asked for the DDList value (this is the data value). So I modified the DDLists to have a different data value (without the $) then modified the command to use the data value for the calculation. I changed the calculation to run on the Calculate event of the Total field. The calculate event will fire when the form loads as well as any time a referenced field in the calculate changes. So when you select a rate the total field will fire automagically!

Oh by the way the data values are set on the binding tab of the DropDown field.

I have attached a modified version of the form you sent.

Paul

Avatar

Former Community Member

Thanks Paul, that's wonderful! You've been a great help.

Kate