What is the best, way to do the following?
Form1 lists items that have a cost value
Form2 is an invoice form
What is the best way to export items with a cost value from form1 into form2?
A user would make item selections in form1 and save the form, then return it, or export data.
Then form2 would retrieve the item selections from form1 and display the cost values which I can sum up at the end of the form2.
Thanks in advance for any advice!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
If both forms have the same objects for the items and the same names, then an export to xml from form1 and importing xml into form2 should work.
Data in the xml that does not match the object names in form2 will be ignored.
In both forms the objects that you want to export/import must have their binding set to Normal/Name in the Object > Bindings tab.
Niall
Views
Replies
Total Likes
Hi,
If both forms have the same objects for the items and the same names, then an export to xml from form1 and importing xml into form2 should work.
Data in the xml that does not match the object names in form2 will be ignored.
In both forms the objects that you want to export/import must have their binding set to Normal/Name in the Object > Bindings tab.
Niall
Views
Replies
Total Likes
Thanks Niall, Just done a test, this works, but I seem to be having a problem calculating the total in form2?
Is this because the data in form2 has been imported into the form? The usual formcalc or js does not appear to work?
Tried both the below:
Sum (CostField1, CostField2)
Total.rawValue = CostField1.rawValue + CostField2.rawValue;
Thanks
Views
Replies
Total Likes
Hi,
Here is a sample: https://acrobat.com/#d=PrU8BF5LIlk-lfloK1KjOQ
The main thing to check is that the script is in the calculate events and to include this line after the importData script:
xfa.form.recalculate(true);
This forces all calculate events to fire, thus updating values to take account of the imported XML values.
Note in the sample, not all of the objects have bindings. For example the Rate and Price columns are set to None binding in both files, therefore the values in the Import file come from the recalculate script.
Hope that helps,
Niall
Views
Replies
Total Likes
Thanks, your example works great.
However, I tried to do this myself without using a table, and am still having problems summing up the total cost value?
Not sure what I am doing wrong?
Views
Replies
Total Likes
Hi,
Can you check the URL and that the file is set to Share/Published.
I cannot access it at the moment:
I am out of the office this afternoon, so it may be the evening.
Niall
Views
Replies
Total Likes
Sorry, I had not published it!
Views
Replies
Total Likes
Hi,
Here is the form back to you: https://acrobat.com/#d=DQchSy3aBzl*Id51UO4QYQ
A couple of things:
I hope that helps,
Niall
Thanks Niall, that helps a great deal. I now understand where I went wrong!
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies