In a Interaction Request Form, is this possible to do an automatic drop down list.The data comes from database.
If so, how can we do it?
Yes, it is possible to query data from a database table and populate a dropdown in a form. Here's a sample script that could go into an IRF script block:
//script starts here
var username = 'sa';
var password = 'secret';
var host= 'dbhost';
//async call back object as you don't want your UI to get stuck while the query results are populated
var queryCallBack = new Object();
queryCallBack.onSuccess = function(result)
//here 'dropdown' is the name of the select widget
//Here 'name' is the name of the database table column which is selected
queryCallBack.onFailure = function(caught)
alert('Error querying the database: '+caught);
//query a table called computers on a MS SQL Server instance. This table has only one column called 'name'
ca_pam_getSQLData('com.microsoft.sqlserver.jdbc.SQLServerDriver', 'jdbc:sqlserver://' + host +':1433;DatabaseName=PAM', username, password, "select * from computers",queryCallBack);
This function can then be called on Form load by putting ca_fd.js.loadFromDB() against the onLoad event
Thanks i want to test
Hello Lokesh Mathur, I would like to display the name for users and recovers in id value. How can we please
The function ca_pam_createSelectStoreFromSQLResult() is overloaded to support both name and value columns in the call. e.g. please try using ca_pam_createSelectStoreFromSQLResult(result,'name', 'id')
Retrieving data ...