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
BedrockMission!

Learn More

View all

Sign in to view all badges

Select and save records from Oracle database

Avatar

Avatar
Level 1
michałk51710037
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
michałk51710037
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
michałk51710037
Level 1

29-09-2017

Hi,

I'm trying to use Javascript code to retrieve some specific records from Oracle database.

This is simple LiveCycle pdf form with 2 fields and a Button with attached click event and below code:

var inName = TextField1.rawValue

var nIndex = 0;

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

{

nIndex++;

}

var oDB = xfa.sourceSet.nodes.item(nIndex).clone(1); // the node pertaining to the data connection specified

//app.alert(oDB.saveXML("pretty"));

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

oDB.nodes.item(1).query.setAttribute("text", "commandType");

oDB.nodes.item(1).query.select.nodes.item(0).value = "Select * from COUNTRIES where COUNTRY_ID = '" + inName + "'";

//app.alert(oDB.nodes.item(1).saveXML("pretty"));

//now connect to DB and get a record

oDB.open()

oDB.close();

So after insert country code in TextField1 and a Button click I obtain corresponding Country_Name in database binded field.

Everything works fine until I try to save the form, after reopen the Country_Name field restores it's default first database record.

I tried to assign the selected record to variable and than use it do write it's value to new static text field, which could be saved, but without success.

The final idea is to open clear or filled previously form insert/reinsert some index and after click find necessary data and save it all, so that when reopened the form is unchanged until next button click.

Any help would be appreciated!

Regards,

Michał

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile
try67
Level 2

30-09-2017

[Question moved to the LiveCycle Designer forum]

Avatar

Avatar
Boost 5
Level 2
Bernd_Alheit
Level 2

Likes

5 likes

Total Posts

65 posts

Correct Reply

4 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 5
Level 2
Bernd_Alheit
Level 2

Likes

5 likes

Total Posts

65 posts

Correct Reply

4 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
Bernd_Alheit
Level 2

29-09-2017

Try the forum for LiveCycle Designer.