Expand my Community achievements bar.

This operation violates your permissions configuration

Avatar

Former Community Member

Hello.

I have been spending some time attempting to create a Livecycle form that is connected to an Excel spreadsheet.  The idea of the form is that you can select a record from the database and view all the current information that is currently populated within this table  Due to the fact there are 500+ records, i am looking for a method in which i can select one of these records to view from a drop down list.  Now i have made the data connection, created the drop down list and the names of the individuals are showing correctly.  However, the link stops there and whoever you select from the drop down does not update the record attached and the first database entry remains.

This is the code i have attached the drop down list:

form1.#subform[0].DataDropDownList::initialize - (JavaScript, client)
/* This dropdown list 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 dropdown.  Specify the table column name used for populating.
sColDisplayText  - this is the display text column of the dropdown.  Specify the table column name used for populating.

These variables must be assigned for this script to run correctly.  Replace <value> with the correct value.
*/

var sDataConnectionName = "DataConnection";  // example - var sDataConnectionName = "MyDataConnection";
var sColHiddenValue = "Employee ID";   // example - var sColHiddenValue = "MyIndexValue";
var sColDisplayText = "Name";   // example - var sColDisplayText = "MyDescription"


// 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"
var nDBIndex = 0;
while(oDB.nodes.item(nDBIndex).className != "command")
{
nDBIndex++;
}

// Backup the original settings before assigning BOF and EOF to stay
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayBOF", "bofAction");
oDB.nodes.item(nDBIndex).query.recordSet.setAttribute("stayEOF", "eofAction");

// 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)
{
  oValueNode = oRecord.nodes.item(nColIndex);
}
if(oRecord.nodes.item(nColIndex).name == sColDisplayText)
{
  oTextNode = oRecord.nodes.item(nColIndex);
}
}

while(!oDB.isEOF())
{
  this.addItem(oTextNode.value, oValueNode.value);
   oDB.next();
}

// Close connection
oDB.close();

I checked the code and after ironing a couple of problems out, it appears to be getting there.  However, i cannot get by this error:

This operation violates your permissions configuration

After checking this forum and many others i established the clone option, but when i add the clone(1) to the end of the following line of code from above:

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

but when i do this the drop down list no longer has the names connected to the database.  i am lost and desperately need this sorted, your help would be appreciated

Thanks

0 Replies