Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Reader- Saved Signatures Causing Varaible to Break

smcurry1234
Level 1
Level 1

Hi,

I have completed a new form that I am sending out to users, and the document variables seem to break after someone signs/saves the document. I have an email button to dynamically send the email based on the raw value of a specific field (EX: Supervisor Email), but it doesn't seem to work after the user saves it. I have confirmed the buttons work just fine when filling the form out for the first time.

I get the error "Microsoft Outlook does not recognize 'Not Valid'" which is the value of the variable in the form. The JavaScript for that variable is below as well. It is almost like the form starts over and doesn't recognize the variable raw values anymore. Any thoughts?

Variable:

supEmail.value = SupervisorEmail.rawValue;

EX JavaScript:

form1.eRACognos.SupSubmit::click - (JavaScript, client)

event.target.submitForm({cURL:'mailto:'+supEmail.value+'?subject='+supText.value+''+Col.value+''+supSubject.value+''+UL.value+''+userName.value+''+Space.value+''+employeeID.value+'&body='+supBody.value,cSubmitAs:"PDF",cCharset:"utf-8"});

0 Replies
smcurry1234
Level 1
Level 1

Each object in the JavaScript is a variable I have created in the Adobe PDF form.

supEmail.value is the name of the variable. +supEMail.value+ is the way it has to be coded in the JavaScript. Anything inside a +xxx+ is a variable in the form.

Test_Screen_Nam
Level 3
Level 3

We can read JavaScript but we can't know what value these variables actually have or how you set them.  I'm especially puzzled by the field rawValue, which exists in XFA forms but not Acroforms.

smcurry1234
Level 1
Level 1

Appreciate everyone's help!

Below are the steps and code for the form.

Step 1: User will complete basic information on who they are, and set .RawValue variables.

Ex: Campus Email. (User EMail.value is the name of the field in the form. In the code below I am just setting the filed value to be equal to the field text input by a users)

form1.eRACognos.Email::exit - (JavaScript, client)

userEmail.value = Email.rawValue;

Step 2: User will select the data package they are trying to gain access to. This package will route to the proper data approve through email based on variables set by the "campus" and "data package" fields.

EX: User has selected the Boulder Campus and Finance data package. By selecting these two values, the email button should generate to the appropriate approverEmail. This email value is set to the FINBLD variable that I have set in the form based on the two selection values.

form1.eRACognos.CIWdata::exit - (JavaScript, client)

CIWdata.value = CIWdata.rawValue

//Finance

if(Campus.rawValue == "Boulder" && CIWdata.rawValue == "Finance")

{

    approverEmail.value = FINBLD.value;

}

else if(Campus.rawValue == "Denver | Anschutz" && CIWdata.rawValue == "Finance")

{

    approverEmail.value = FINDEN.value;

Step 3: User clicks the "send to approver" button which should route to the proper email based on variable selections.

try67
Level 4
Level 4

It sounds like this is a LiveCycle Designer form. I'll move your question to the relevant forum.

Bernd_Alheit
Level 3
Level 3

Try the forum for LiveCycle Designer.

smcurry1234
Level 1
Level 1

Thanks for pointing me to the right forum everyone!

BarlaeDC
Level 5
Level 5

HI,

From what you have posted there is no problem that I can see, are you able to share the form? (using a file sharing service)

The error -

We don't know which variable is throwing this error, as the line of code has the following variables

supEmail.value

supText.value

Col.value

supSubject.value

UL.value

userName.value

Space.value

employeeID.value

supBody.value

And as has been mentioned before, without more information about what they are or how they are created it is difficult to provide guidance as to where the problem could be.

To start diagnosing this problem I would do the following.

- Remove all unnecessary variables, leaving just enough to be able to create an email.

- Assuming that works, I would then add one variable at a time back in until you find the one that causes the error, this would enable it to be narrowed down to which part(s) of your code need to be investigated.

Hope this helps

Malcolm

radzmar
Level 10
Level 10

The form variables you've added under the form properties can't be modified permanently by scriptings but only for the current session. That's because the form variables are located in the template DOM which is read only. Everytime you open the form in Adobe Acrobat/Reader it creates a virtual form DOM by merging the template DOM and the data DOM. This form DOM represents the current state of the form is rendered to the screen. Whenever you add a signature you're forcing the app the remerge the template and data DOM to a new form DOM, and at this point your're losing the changes to the form variables applied by scriptings before.

To store data in the form you better use the data DOM, which can be changed everytime.


In the XML view of Designer search for "<xfa:datasets".

If it doesn't exist, add it right after the </config> tag.

Otherwise add you own XML structure right below the element <xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"> as shown below.

</config>

<!-- the datasets of the form -->
<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">

<!-- here your personal data DOM begins --> 
<myData>

      <username>John Doe</username>

      <email>user@domain.org</email>

  </myData>

<!-- here your personal data DOM ends -->

<!-- the forms data DOM where all entered data goes. DO NOT TOUCH IF IT EXISTS! -->

  <xfa:data xfa:dataNode="dataGroup"/>

</xfa:datasets>

<localeSet xmlns="http://www.xfa.org/schema/xfa-locale-set/2.7/">

To access the values use i.e.:

xfa.datasets.myData.username.value