Expand my Community achievements bar.

Warning / Error using the tutorial "Providing interactive database lookup from forms"

Avatar

Former Community Member
Hello,



I have followed the tutorial "Providing interactive database lookup from forms". Adobe LifeCycle is giving me the following warning / error:



Generating PDF Document...

Font Service: Default font typeface is Myriad Pro.

Script failed (language is javascript; context is xfa[0].form[0].form1[0].#subform[0].SelectField[0])

script=/* This listbox object will populate two columns with data from a data connection.

sDataConnectionName

- name of the data connection to get the data from.

- Note the data connection will appear in the Data View.

sColHiddenValue

- this is the hidden value column of the listbox.

- Specify the table column name used for populating.

sColDisplayText

- this is the display text column of the listbox.

- Specify the table column name used for populating.

These variables must be assigned for this script to run correctly.

*/

var sDataConnectionName = DataConnection;

var sColHiddenValue = ID;

var sColDisplayText = PART_NO;

// Search for sourceSet node which matchs the DataConnection name

var nIndex = 0;

while(xfa.sourceSet.nodes.item(nIndex).name != sDataConnectionName)

{

nIndex++;

}

var oDB = xfa.sourceSet.nodes.item(nIndex);

oDB.open();

oDB.first();

// Search node with the class name command

nIndex = 0;

while(oDB.nodes.item(nIndex).className != command)

{

nIndex++;

}

// Need to set BOF and EOF to stay

oDB.nodes.item(nIndex).query.recordSet.setAttribute(stayBOF, bofAction);

oDB.nodes.item(nIndex).query.recordSet.setAttribute(stayEOF, eofAction);

Adobe LiveCycle Designer 7.0

Providing interactive database lookup from forms

// Search for the record node with the matching Data Connection name

nIndex = 0;

while(xfa.record.nodes.item(nIndex).name != sDataConnectionName)

{

nIndex++;

}

var oRecord = xfa.record.nodes.item(nIndex);

// Find the value node

var oValueNode = null;

var oTextNode = null;

for(var nColIndex = 0; nColIndex < oRecord.nodes.length; nColIndex++)

{

if(oRecord.nodes.item(nColIndex).name == sColHiddenValue)

{

o

ValueNode = oRecord.nodes.item(nColIndex);

}

else if(oRecord.nodes.item(nColIndex).name == sColDisplayText)

{

o

TextNode = oRecord.nodes.item(nColIndex);

}

}

while(!oDB.isEOF())

{

this.addItem(oValueNode.value, oValueNode.value);

//IDList.addItem(oValueNode.value, oTextNode.value);

oDB.next();

}

// Close connection

oDB.close();

Error: Syntax error

PDF generated successfully.



Can somebody tell me what I am doing wrong?



Greetigs,



Gene
0 Replies