Thursday, April 5, 2018

Missing script in Dexterity forms

I was creating a new form in Dexterity and I needed a form "Post Script" to clear a table before the form closed.  I wrote the script and saved it but when I went back to it there was no script present.

The other sign of this problem you'll see when you open the script again and it has the name with "_DUP" after it.  This plus your missing script is a clear indication that Dexterity lost your script.

While this happened to me on a form Post Script it could as well happen on a Pre Script.

I know this has happened to me before but I could not recall the solution.

The script is still in the form but Dexterity cannot locate it.  I don't know internally what is happening but to solve this you have to export, edit, then import the form as detailed below.

  1. Stop development of the form.  Go to the Resource Explorer toolbar and Export the form to a file.
  2. Create a second copy of the export file to work on, preserving the original for backup if needed.
  3. Open the exported file in a text editor and locate the following lines of code.  These should be fairly high in the file.
 EventPost ""
 EventPre ""

  1. Add the script name to the appropriate Event as below.
 EventPost "PO_Receiving_FORM_POST"
 EventPre ""

  1. Save the modified form and import it back into Dexterity.

Open the form again in Dexterity and you should find the script present.

If you need to find the script name scroll down to the bottom of the export file and locate your code.  You should see the PRE or POST script name beside the EventScript keyword.

*UPDATE*
This just happened again in the same form with a script on my scrolling region.  I was testing and noticed the script appeared to not be firing.  When I went back into the form to look at the script it was gone and the tell-tale "_DUP" was there in the name.

To solve this I followed the above process but this time had to update the EventLineFill value in the ScrollingWindow section with the name of the SCROLL_FILL script from the EventScript section.

Also I have found that you need to recompile the dictionary after importing the form to avoid "FP:Script not found" errors.

No comments:

Post a Comment