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 Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Passing value to SQL Server Stored Procedure


Not applicable
I'm using LiveCycle Designer 8.2 and SQL Server 2005 Pro.

I have a form and made a connection to the database. I want to pass a value (the pdf filename) to the stored procedure and have the value returned from the stored procedure display in a numericfield (the return value is an integer). All I really need to know is: how can I pass values to the stored procedure from within the PDF?


(in form.initialize event)

var filename =

Numericfield1.rawValue = storedProc(fileName)
2 Replies


Level 10
To make a call to the database all of the information about that connection is stored in a structure called sourceSet. To be able to pass the filename into the SQL statement you must programatically adjust these parameters. Usually we set the data conection to be delayed open (so we can set the values) then open th econnection ourselves. Note you shoudl also close the connection when you are finished. Here is an example of how to access the parameters:

//set up sql call to DB to get specifics about employee

//Set the sourceSet to accept SQL commands

xfa.sourceSet.DataConnection.nodes.item(1).query.setAttribute("text", "commandType");

//set the SQL that you want to execute

xfa.sourceSet.DataConnection.nodes.item(1) = "Select * from employees where EmpID = '" + EmpID.rawValue + "'";


//now connect to DB and get a record


Level 1

Do you do this on F.initialize?  Thanks