Expand my Community achievements bar.

problem with calculated field (I want to hide it if value = 0, but it doesn't disappear)

Avatar

Former Community Member

Hi all,

I've got  a problem with my form (an invoice, you can see pdf file at http://www.fornoantico.it/fatture/fattura-definitiva-togli-zeri.pdf), in particular on a calculated field... I want to hide it if value = 0, but it doesn't disappear

I've tried to use Action Builder, but "ok" button is disabled, and shows this alert "actions may not work with forms targeting html or guide"

I've tried to use some formulas like

if (IMPORTO[0] == 0) then

IMPORTO_SCONTATO[0].presence="invisible"

else

IMPORTO_SCONTATO[0].presence="visible"

endif

(I've got a IMPORTO field that contains Quantity * Price, then a SCONTO flied that contains only the discount value calculated as IMPORTO * SCONTO / 100, and an IMPORTO_SCONTATO field that contains that contains the price inclouding discount, calculated as IMPORTO - SCONTO)

But it doesn't work, this IMPORTO_SCONTATO field is always present showing 0 value, and this is a problem because in this invoice if we have a few rows then we have zeros in other ones (see image)

Can you please help me solving this issue? I'm going nuts, I'm working on it since last week.

Thanks a lot

fattura-definitiva-togli-zeri-con-errore.jpg

2 Replies

Avatar

Level 3

The link you provided does not match the image above.  Do you have a schema (.xsd) for the data that will be bound to the form?  Usually a form with repeating rows has a schema associated with it.  See for example Ben Lyon's Adobe Developer Connection article on binding rows with repeating elements to a subform.  In your form, there would only be one data row and it would be bound to the repeating element in the schema or sample XML.  You might have to play around with the cell borders to make sure the form fills the page as you have it shown but you won't have empty rows with spurious totals.

Avatar

Former Community Member

hi, I've removed that link because I've redone my pdf, using dynamic table (with two buttons to add and remove rows) and now it's all fine.

thanks a lot

best regards