Using dynamic lookup fields in subforms
I figured out how to do this on a regular form, but then I had the "brilliant" idea to make it have a subform so that more than one item could be ordered. It isn't working though. I would appreciate any help. I am anxious to learn Creator and seeing all that it can do.
So, i created two new forms.
salesTemplate - The subform with the lookup fields on it
salesTemplate2 - The form that the subform will be on.
The code I wrote for a regular form is this:
- //Set Price field
- newprice = Products [ID == input.Product];
- input.Price = newprice.Price;
- //Get tax info if applicable
- getproduct = Products [ID == input.Product];
- if (getproduct.Taxed)
- {
- input.Tax = (input.Price * 0.07);
- }
- else
- {
- input.Tax = 0;
- }
- //Get Total Cost
- if (input.Tax > 0)
- {
- input.Total = (input.Price + input.Tax);
- }
- else
- {
- input.Total = input.Price;
- }
I'm not really understanding why this isn't working. I haven't changed any field names, so shouldn't it still work? I don't get any errors - it just doesn't insert the price, tax and total into the boxes.
Thanks for any help.