I'm new to Adobe Forms development and I've run into a roadblock. I'm connecting to a web service I've created to populate data into a form. The form is for internal use only and only using Acrobat Reader with Extensions. I've followed several articles I've found to make progress but I've got one problem I haven't been able to overcome yet.
I connect a drop down list to the web service to populate the list. When an item is selected from that list, I call the web service again to retrieve to more data values and populate two more fields in my form. This all works great and as described. The problem is that these fields are part of a repeating table. When a new line is added to the table and new value is selected from the drop down list on that line, all secondary values in the table change as well. So the drop down list choice on line two not only populates the data lookup values for line two, but it also overwrites the values on line one.
I've found articles that talk about using a postExecute event handler to process the web service data. I've tried using this to manually load the data instead of using the automatic mapping. But I never seem to be able to access the web service response the way the articles indicate I should be able to. I'm hoping someone can point me in the right direction for how to resolve this. Is postExecute the way to fix my issue? if not, what's the best approach?
This is the article I followed to setup the automatic mapping:
This is the best article I've found on the postExecute event:
it should follow this strucuture near the bottom of the object:
<event activity="postExecute" ref="$xfa.connectionSet.CityQuery" name="event__postExecute">
console.println(xfa.datasets.saveXML("pretty")); //better to use console.println() as it might be too large a string for a message box.
I was able to reproduce what you described. I resolved the problem without any preExecute or postExecute scripts. Don't include the bound fields in your repeating subform. Instead, leave the bound fields elsewhere in the form and hide them in a hidden subform (exclude from layout). When you need to invoke the service, programatically copy the input value(s) from your repeating subform fields to the hidden input field(s) that are bound to the web service. Then programatically invoke the service. Then copy the values from the bound/hidden output fields to the fields in the repeating subform. I have an example that illustrates this, but I don't know how to upload it here.
I don't believe the syntax has changed, but you still need to add the postExecute() event in the XML Source, as it is still not exposed in the UI (as the article describes).
if there is a syntax issue, I would recommend opening a support ticket in our daycare portal (https://daycare.day.com/home.html), but we would need a mockup sample that mimics your form contacting that webservice, so we could assist with the troubleshooting.
That's the article I'm trying to follow. The problem is that I don't see any data when the postExecute event fires. When I try to access it, it doesn't seem like I've received a response. But I know the web service works and I know I can receive a response in the form. It's specifically in accessing the response data in the postExecute event that I need help. Has the syntax for accessing that data changed since that article was published?
what is the binding described in your table, or repeating subform? you may want to review this article posted here as it describes in detail how you might be able to reformat the data using the postExecute() event:
The trick will be to capture the data first the moment in time after it is executed, and see what is being returned using a technique similar to the following:
without being able to see your form and the wsdl definition, it will be difficult to give you specific feedback, but it may be that the data being returned and bound to the table is not being correctly mapped. you can use the postExecute() event as shown in this article to perhaps get the data in the correct structure for the table.