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

Gathering info from SQL Database

Avatar

Not applicable
I want to my users to be able to enter an account number and it return name and address. I have created the Dataconnection and set it to delayed open. The sequal command that i am using is "select * from memb where acct = '" I have it set as an exit command currently but can change it if i need to. It is running on a server and as a formcalc. Do I need to Bind the name and address field to my data connection name and address?
5 Replies

Avatar

Level 10
Yes you need to bind the results of your query to the fields on your form.

Avatar

Not applicable
I keep getting a "Couldn't post data to", Here the script from... What is wrong???



topmostSubform.Page1.P.acct::exit - (FormCalc, server)



xfa.sourceSet.DataConnection.nodes.item(1).query.setAttribute = "text"

xfa.sourceSet.DataConnection.nodes.item(1).query.select.nodes.item(0).value = "Select * from memb where acct = '", this.rawValue, "'")

//app.alert(xfa.sourceSet.DataConnection.nodes.item(1).query.select.nodes.item(0).value);



//now connect to DB and get a record

//xfa.sourceSet.DataConnection.open()

//xfa.host.messageBox ("Data Connection Opened")

Avatar

Level 10
You have your code set to run server side but you are not rendering from a server. Change it to run client side.

Avatar

Not applicable
Okay, I have changed to client and when i Check my script syntax it is not liking this field. Do I need to have it set on formcalc or javascript?



xfa.sourceSet.DataConnection.nodes.item(1).query.select.nodes.item(0).value = "Select * from memb where acct = '" + this.rawValue +