-
Hello Sainzmichael,
What you want to do can be done directly using the default InfoPath SP1 functionality (without any code). For the subTotal field set the Default value as number(Price) - number(Discount). This will give you the sub total value for each line item.
Now in the grand total field set the Default value as sum(subTotal). What sum ...