Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Calculating dynamic values from dropdown lists

Avatar

Level 1

Hi all, here's the noob question of the day

I'm creating an invoice form in LiveCycle Designer and I'm totally stuck at tax calculations:

for each product you're able to choose between two tax percentages from a dropdown list and, at the end of the form, I want to show a total amount of each tax.

productqtyunit price
vatnet price
red shoes pack220$4%40$
black shoes pack125$4%25$
white umbrella110$7%10$

total net price75$
+ TAX 4%2.60$
+ TAX 7%0.70$
Total78.30$

How can I set the + TAX 4% and + TAX 7% fields to grab their respective product rows?

Sorry for my bad english.. I hope you get the question!

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

If you send your form to LiveCycle8@gmail.com I will code it up for you to give you the idea of how to do it. Please include a description of what you want done in the email.

Paul

View solution in original post

4 Replies

Avatar

Former Community Member

You woudl have to look at each row inside of a for loop and then determine if that row had 4% or 7% tax. Then you coudl keep a running total of the tax for you calcultions such that when the for loop ended you would have the 4 and 7% totals calculated.

Make sense?

Paul

Avatar

Level 1

uhm yes it does, can you suggest a practical example for someone who's not really a coder?

Avatar

Level 1

back to this form and still stuck.. can anyone provide a code example, please?

Avatar

Correct answer by
Former Community Member

If you send your form to LiveCycle8@gmail.com I will code it up for you to give you the idea of how to do it. Please include a description of what you want done in the email.

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----