Update PDF fields with SQL data not working




LiveCycle Designer 8.0 (version 8.05.2073.1.374024)

I have a simple numeric field box, a "find record" button and a few text boxes that are supposed to be updated with the data from the data connection. What's supposed to happen is after filling in a record ID in the numeric field and clicking on the find record button the other text fields are populated via the ODBC connection to SQL server. It all works fine if I connect the backend to an Access database. If the backend DB is SQL it just doesn't work. I don't know JavaScript or FormCalc so I'm using code found off of examples. My existing SQL connection is called "conServicePro". Initally it's connected to a table and I can see the first record when I preview or fully show my work in progress PDF.

Here is the latest way I've tried:

----- form1.#subform[0].Button1::click: - (FormCalc, client) ---------------------------------------

if (Len(Ltrim(Rtrim(txtAccountKey.rawValue))) > 0) then

//Change the commandType from TABLE to TEXT. TEXT is the equivalent of SQL Property

xfa.sourceSet.conServicePro.#command.query.commandType = "TEXT"

//Set the Select Node. Select in this case will be whatever the SQL Property you want.

xfa.sourceSet.conServicePro.#command.query.select.nodes.item(0).value = Concat("SELECT * FROM dbo.tblMainAccounts Where AccountKey = ", Ltrim(Rtrim(txtAccountKey.rawValue)), "")

//Reopen the Dataconnection



will produce a "Script Failed" error box containing the script above and no explination as to why it failed.

Any ideas?





The issue is that the code you are using is Javascript and you have the button click event to expect FormCalc .....change it to JavaScript and try again. The drop down on the top right corner of the script editor will allow you to change the scripting language that is used for that event.

Hope that helps