14 Replies Latest reply on Oct 27, 2009 12:08 PM by Mark Lindberg

    Button Script executing in Workspace loses context after web service call in Non-Reader extended form

    Mark Lindberg Level 2


      My environment uses Workspace, and non-reader extended forms.

      We have data connection access to WSDLs to return data for Dropdowns - (This is working).


      The issue we have encountered, is when we have a script running (button or otherwise) that has JavaScript code to execute after the service call.

      Once the call fires, and the data returns - all script context is lost.

      "<object> is not defined" errors occur when trying to reference any object in the form or the data returned.


      A scenario would be a button click event that:

      1. Moves form field data to the WSDL Request data area.

      2. Invoke the WSDL

      3. Evaluate result of WSDL call

      4. Move data form result are to form fields.


      In our experience, after step 2 the code loses the ability to address any part of the form.

      We have tried to display out the form's somExpression, and the result is "Undefined".


      We have the DataConnection execute set to run on server, and have tried setting the button to run on Client, Server or both.


      Once the form reloads in the UI, the form behaves as expected, but steps 3 and 4 above have been lost.

      Remerge and Relayout commands do not seem to help the situation.


      Our desired application is trying to use a single dataconnection multiple times to populate 10 different logical areas on the form.

      Without being able to retain context for the round trip, it is very difficult to properly trap errors and process results.


      Can anyone offer advice on how to have the script not lose context, or wait until the form is ready to continue?


      Thank You