Expand my Community achievements bar.

Problem firing User-runtime scripts when importing xml

Avatar

Level 2

Hello

The forms that I’m working on will be exporting xml, and then importing the xml again when the user re-opens them. That works just fine.

The problem is any actions that the user has done previous to export that should hide or reveal sections (for example, clicking a radio button) are not shown when the xml is imported again. The radio button list shows the value, but the action that should result from it isn’t shown.

Is there any simple way to have these results included in the imported xml? Or do I have to include a execEvent() script in the docReady event for every single user runtime script. I have a lot of them, so I rather find a simpler solution if is there is one.

Thanks in advance for any help.

Connie

1 Reply

Avatar

Former Community Member

Hi,

  I assume you selected "Automatically" for preserve script changes option in File -> FormProperties -> Defaults(Tab) -> Preserve script Changes to form when saved.

If this is not the actual cause for your problem, try to write code in the form or the object initialize event.

In form:initialize

check the dataxml values and show or hide the fields accordingly.

for example,

if($record.address.name.value = "XYZ") { or xfa.datasets.data.address.name.value }

form.subform1.textfield1.presence = "visible";

this might be a little round about, maybe there is a better solution.

k.c