Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Total Formula (Column Total versus Row Total)

melindal5122814
Level 1
Level 1

I'm currently working on a table where I need to configure the total amount worked by their pay rate. When I create the total formula it doesn't work. The formula I had was $.rawvalue= Rows.WorkTotal.Cell3 * Rows.PayRate.Cell3. Could I please get some guidance on what I could get done?

7 Replies
Magus069
Level 10
Level 10

Hi there,

not quite sure what the error can be, you do not give much details about the behavior or any errors that occur...

but by looking at the formula you have written in the forum, let's say rawvalue needs a capital 'V' -> rawValue

Hope this help!

melindal5122814
Level 1
Level 1

HI @Mangus069,

The issue Im having if after putting in that formula to in the Total field and switch over the PDF to input the two data (WorkTotal * PayRate) points to get the total the information doesn't show or sum up in the PDF.

Subramaniv22778
Level 1
Level 1

Have you written the script under 'Formcalc' instead of 'Javascript'? and put it for the event 'Calculate'

melindal5122814
Level 1
Level 1

Hi Subramaniv22778,

Yes, I have it under the event "calculate" I'm not sure on on the FormCalc instead of Javascript. I'll have to double check. Would it matter if I was working with total columns versus rows?

Subramaniv22778
Level 1
Level 1

Check whether its under 'Formcalc' and Columns Vs Rows?

melindal5122814
Level 1
Level 1

Subramaniv22778​, I checked on whether its Formcalc and it was under javascript. And it fixed the issues. The other question I had was do you know what the formula would need to be if I needed put a limited number they could enter? For example, they are putting in the expense amount for meals and it can't exceed $50 per day. How would I go about scripting that?

Subramaniv22778
Level 1
Level 1

if (NumericField.rawValue > 50)

{

xfa.host.messageBox("You can't exceed $50!","Error",3,1);

NumericField.rawValue="";

xfa.host.setFocus(NumericField);

}

Write this under 'Javascript' , for the event 'Exit'. Replace 'NumericField' by your FieldName.