This topic contains 4 replies, has 0 voices, and was last updated by Anonymous 11 years, 3 months ago.
- June 17, 2009 at 11:07 am #226
I’m trying to work out how it would be possible to perform a batch update process across all forms in a collection, the resulting field update in the form being dependant upon criteria already held on the same form.
My requirement is to periodically produce a report containing data from all forms with a date field containing a date which is older than x days. Once reported, it should not be reported again. My approach would be to run an update across the forms using the same criteria as the report production, setting a ‘reported’ flag after printing the report off, but how?. Perhaps there is even a way of doing this at report run-time?
JulianJune 17, 2009 at 11:54 am #4616
You can certainly set up your reports to show the information based on a date field on your form (ie > xx days ago) but to then update those form instances so they will not report again would seem to call for usage of the API triggered from an event on your report that can then update your required form instances.
Have a look to the user guide for the API to see if that gives you what you require.
/Documentation/manual/html/api.htmJune 17, 2009 at 1:13 pm #4617
You could probably also do this with a form that you can ‘call’ from the report (using the ‘show form’ action).
This form can be set up to read the data into a table object to present all the form instances that meet your required criteria (one of these criteria would be a form field that by default is saying ‘not currently reported’), and then you can run a script to set a ‘already reported’ field, and then write that back to the form instance to update them.June 17, 2009 at 2:30 pm #4618
Thanks that sounds an interesting way to go – what would be a reasonable maximum quantity of transactions to read into a table object and update in this way?June 17, 2009 at 4:12 pm #4619
I can’t see there would be a maximum to worry about ? you probably only need to be reading in 2 or 3 fields to each row (a unique identifier.. name perhaps, reported .. that would read in as empty, but what you then change by script to be ‘reported’ to write back and the form instance ID.. so each form instance can then be identified in the ‘update’ back as part of the ‘where’ clause)
You must be logged in to reply to this topic.