Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Invalid property get operation; subform doesn't have property 'rawValue'

Avatar

Level 7

Hello,

I have a form where on the Submit button I'm putting JavaScript that checks each field and radio button set to ensure the user has filled something in. I have used this script before successfully, but this time it is not working and for the life of me I can't see what wrong. Also, I've not encountered this particular error message before. Here is the text I am seeing on clicking the Submit button:

Acrobat JavaScript Debugger Functions Version 11.0

Acrobat EScript Built-in Functions Version 11.0

Acrobat SOAP 11.0

Exception in line 5 of function top_level, script XFA:form1[0]:page2[0]:buttons[0]:Button1[0]:click

GeneralError: Operation failed.

XFAObject.rawValue:5:XFA:form1[0]:page2[0]:buttons[0]:Button1[0]:click

Invalid property get operation; subform doesn't have property 'rawValue'

I'm glad to share my script if that's helpful as well.

Thanks in advance for your help,

MDawn.

1 Accepted Solution

Avatar

Correct answer by
Level 10

The exception states that the XFA object with the SOM expression page1.firstPage.positioned.header.posSub.storeNbr is not a field but a subform.

View solution in original post

8 Replies

Avatar

Level 10

So far I can see that you have a button "Button1" with a click event that tries to get the rawValue of a subform in line 5 of the script.

But you better post the entire script you're using. ;-)

Avatar

Level 7

Here's the script:

var v1 = page1.firstPage.positioned.firstLine.reqType.rawValue;

var v2 = page1.firstPage.positioned.firstLine.orderQuote.rawValue;

var v3 = page1.firstPage.positioned.description.rawValue;

var v4 = page1.firstPage.positioned.rentExempt.rawValue;

var v5 = page1.firstPage.positioned.header.posSub.storeNbr.rawValue;

var v6 = page1.firstPage.positioned.header.posSub.storeName.rawValue;

var v7 = page1.firstPage.positioned.header.posSub.RadioButtonList.rawValue;

var v8 = page1.firstPage.positioned.header.posSub.storeContact.rawValue;

var v9 = page1.firstPage.positioned.header.posSub.email.rawValue;

var v10 = page1.firstPage.positioned.header.posSub.contactsPhone.rawValue;

var v11 = page1.firstPage.positioned.header.posSub.custName.rawValue;

var v12 = page1.firstPage.positioned.header.posSub.custPhone.rawValue;

var v13 = page1.firstPage.positioned.header.posSub.custEmail.rawValue;

var v14 = page1.firstPage.positioned.dateNeeded.RadioButtonList.rawValue;

var v15 = page1.firstPage.positioned.dateNeeded.addlInfo.DateTimeField2.rawValue;

var v16 = page1.firstPage.positioned.dateNeeded.addlInfo.rushFees.rawValue;

var v17 = page1.firstPage.positioned.dateNeeded.rushProcessingFees.rushFeePrices.rawValue;

var v18 = page1.firstPage.positioned.dateNeeded.rushProcessingFees.RadioButtonList.rawValue;

var v19 = page1.firstPage.positioned.chairsArtInfo.RadioButtonList.rawValue;

var v20 = page2.personalization.header.RadioButtonList.rawValue;

var v21 = page2.shipping.shipTo.RadioButtonList.rawValue;

var v22 = page2.shipping.customerAddress.rawValue;

var v23 = page2.shipping.rushOrders.RadioButtonList.rawValue;

//REQUEST

if ((v1 == "") || (v1 == null))

{

   xfa.host.messageBox( "Please select the type of request" );

   xfa.host.setFocus("page1.firstPage.positioned.firstLine.reqType");

//ORDER_QUOTE

} else {

if ((v2 == "") || (v2 == null))

{

    xfa.host.messageBox( "Please indicate whether this is an order or quote" );

  xfa.host.setFocus ("page1.firstPage.positioned.firstLine.orderQuote");

//DESCRIPTION

} else {

  if (((v1 == "3")) && ((v3 == "" || v3 == null)))

{

  xfa.host.messageBox( "Please enter a description" );

  xfa.host.setFocus("page1.firstPage.positioned.description");

//RENT EXEMPT

} else {

  if (((v1 == "2")) && ((v4 == "" || v4 == null)))

{

  xfa.host.messageBox( "Please indicate if the order is rent exempt or royalty exempt" );

  xfa.host.setFocus("page1.firstPage.positioned.rentExempt");

//STORE NUMBER

} else {

  if ((v5 == "" || v5 == null))

  {

     xfa.host.messageBox( "Please enter the store number" );

     xfa.host.setFocus("page1.firstPage.positioned.header.posSub.storeNbr");

//SCHOOL'S NAME

} else {

  if ((v6 == "" || v6 == null))

  {

     xfa.host.messageBox( "Please enter the school's name" ); 

  xfa.host.setFocus ("page1.firstPage.positioned.header.posSub.storeName");

  

//COUNTRY

} else {

if ((v7 == "") || (v7 == null))

{

  xfa.host.messageBox( "Please enter the store's country" );

  xfa.host.setFocus("page1.firstPage.positioned.header.posSub.RadioButtonList");

//STORE CONTACT

} else {

if ((v8 == "") || (v8 == null))

{

  xfa.host.messageBox( "Please enter the name of the store's contact person" );

  xfa.host.setFocus("page1.firstPage.positioned.header.posSub.storeContact");

//CONTACT'S EMAIL

} else {

  if ((v9 == "" || v9 == null))

  {

     xfa.host.messageBox( "Please enter the store contact's email address" );

     xfa.host.setFocus("page1.firstPage.positioned.header.posSub.email");

//CONTACT'S PHONE

} else {

if ((v10 == "") || (v10 == null))

{

  xfa.host.messageBox( "Please enter the customer's telephone number" );

  xfa.host.setFocus("page1.firstPage.positioned.header.posSub.contactsPhone");

//CUSTOMER NAME

} else {

if ((v11 == "") || (v11 == null))

{

  xfa.host.messageBox( "Please enter the customer's name" );

  xfa.host.setFocus("page1.firstPage.positioned.header.posSub.custName");

//CUSTOMER PHONE

} else {

  if ((v12 == "" || v12 == null))

  {

     xfa.host.messageBox( "Please enter the customer's telephone number" );

     xfa.host.setFocus("page1.firstPage.positioned.header.posSub.custPhone");

//CUSTOMER EMAIL

} else {

if ((v13 == "") || (v13 == null))

{

  xfa.host.messageBox( "Please the customer's email address" );

  xfa.host.setFocus("page1.firstPage.positioned.header.posSub.custEmail");

     

//DATE NEEDED

} else {

if ((v15 == "") || (v15 == null))

{

  xfa.host.messageBox( "Please whether the order is needed by a specific date" );

  xfa.host.setFocus("page1.firstPage.positioned.dateNeeded.RadioButtonList");

//SPECIFIC DATE

} else {

  if ((v16 == "" || v16 == null))

  {

     xfa.host.messageBox( "Please enter date the order is needed" );

     xfa.host.setFocus("page1.firstPage.positioned.dateNeeded.addlInfo.DateTimeField2");

//RUSH FEES

} else {

  if ((v17 == "" || v17 == null))

  {

     xfa.host.messageBox( "Please indicate if rush fees are applicable" );

     xfa.host.setFocus("page1.firstPage.positioned.dateNeeded.addlInfo.rushFees");

//RUSH PROCESSING FEES

} else {

  if ((v18 == "" || v18 == null))

  {

     xfa.host.messageBox( "Please select the rush processing fee that is wanted" );

     xfa.host.setFocus("page1.firstPage.positioned.dateNeeded.rushProcessingFees.RadioButtonList");

  

//CHAIR ART INFORMATION

} else {

  if ((v19 == "" || v1 == null))

  {

     xfa.host.messageBox( "Please identify the format of the art for the chair" );

     xfa.host.setFocus("page1.firstPage.positioned.chairsArtInfo.RadioButtonList");

  

//PERSONALIZATION

} else {

  if ((v20 == "" || v20 == null))

  {

     xfa.host.messageBox( "Please identify whether personalization is needed for this order" );

     xfa.host.setFocus("page2.personalization.header.RadioButtonList");

      

//SHIPPING INFO

} else {

  if ((v21 == "" || v21 == null))

  {

     xfa.host.messageBox( "Please identify where the order will be shipped" );

  xfa.host.setFocus("page2.shipping.shipTo.RadioButtonList");

      

//CUSTOMER'S ADDRESS

} else {

  if ((v22 == "" || v22 == null))

  {

     xfa.host.messageBox( "Please provide the customer's address" );

     xfa.host.setFocus("page2.shipping.customerAddress");

//RUSH FEE

} else {

  if ((v23 == "" || v23 == null))

  {

     xfa.host.messageBox( "Please select the rush fee that the customer wants" );

     xfa.host.setFocus("page2.shipping.rushOrders.RadioButtonList");

          

} else {

{

  Button2.execEvent("click");

}

}}}}}}}}}}}}}}}}}}}}}}

Avatar

Correct answer by
Level 10

The exception states that the XFA object with the SOM expression page1.firstPage.positioned.header.posSub.storeNbr is not a field but a subform.

Avatar

Level 10

Hi there,

by looking at your code it is a pain to try to find the error, even though it can be obvious sometimes...

it can be a typo or as radzmar says the object is not a field in this situation..

a good way to evade these kind of errors on validation, especially if you write your own validation is to have a validation script that can be adapted to your form when you change your form..

if you will need to change your form, well you will need to change your code... if you are interested in having a validation script easy to manipulate, have a look at my thread

A PDF form is available to see how it works

Validation / Reset Functions, easy to manipulate and to change Forms!!!!

Avatar

Level 7

Hi, radzmar,

Thanks for your feedback. As far as I can tell, the object is a field within a subform. Is there something specifically I should look for? I also deleted the field and re-entered it.

Would you expect if I "remmed" out line 5 and corresponding lines that the error would go away? I tried that and it didn't. I'm not sure exactly what to look for. Would posting my form help?

Thanks,

MDawn

Avatar

Level 10

Hi there again,

if you want to find exactly what is the error in your code use a try catch exception

using the try catch statement, you will more likely be able to find exactly where is the error...

as it says line 5 it can be any other line above 5 because it depends on which line your code is starting on..

If your event starts on line 4 and the error is on line 5, then you should make the math and figure out that the error is on line 9 and not on 5...

If you still don't know what the error is, post the exception caught with the try statement.

Hope this help!

Avatar

Level 7

Thanks. I'll try that.

Margaret

Avatar

Level 7

Thank you both for your help-understanding the meaning of the error message and how to troubleshoot. It wasn't specifically line 5, but a few lines down. I have it working now!

Thanks again for all your help.

Margaret