Hi All,I have a quey regarding dbcolumn & dblookup using XML on web implemented the same “dbcolumn & dblookup using XML on web” but few data are not populating.
-
DBColumn is not populating all 310 records only showing 100 records. It is quite possible the variable is not supporting the large number of records.
-
Same issue is with DBLookup. I m using the below code :
I m using the below java script function to fetch data using dblookup hopwever getting output in a single row in combo box :
CN=Sanjay Prasad/O=XYZ/C=US CN=John Abraham/O=XYZ/C=US CN=Abhijit Sawant/O=XYZ/C=US CN=Prakash Singh/O=XYZ/C=US
I need to display only first name and last name. I tried splliting the data also but getting error “Object doesn’t support this property or method”.
CODE
=====================================
function dbLookup(server,path,view,key,column,ObjStatusReportFor)
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
var pos=0;
currURL = (document.location.href).toLowerCase();
if (trim(server) == "")
{
pos = currURL.indexOf('://');
if (pos < 0 )
server = "http://www.ttpartners.com" // PUT YOUR SERVERNAME HERE
else
{
pos += 3;
pos = currURL.indexOf('/', pos);
server = currURL.substring(0, pos)
}
}
if( trim(path) == "" )
{
if( pos > 0 )
{
newPos = currURL.indexOf('.nsf',pos);
if (newPos > 0)
{
path = currURL.substring(pos+1,newPos+4)
}
}
}
//Javascript index starts at 0, so need to decrement the column by -1
if( !isNaN(column) )
column -= 1;
vurl = trim(server)+"/"+trim(path)+"/"+viewnameadd+"?readviewentries&startkey="+key;
xmlDoc.load(vurl);
if (xmlDoc.documentElement == undefined)
{
return("")
}
nodes = xmlDoc.documentElement.childNodes;
temp = new Array(nodes.length);
var j = 0;
for (var i = 0; i < nodes.length; i++)
{
if(nodes.item(i).childNodes.item(0).text==key)
{
temp[j] = nodes.item(i).childNodes.item(column).text;
j++;
}
else
{
break;
}
}
results = new Array(j);
for (var i = 0; i < j; i++)
{
results[i] = temp[i];
}
writeInCombo(results,ObjStatusReportFor)
}
// To used for writing data into combo box
function writeInCombo(data,fldCombo)
{
fldCombo.length=0
fldCombo.length +=1
fldCombo[fldCombo.length-1].text = "Choose a Person Name for this Status Report"
var newData = data.split(“CN=”); Error : “Object doesn’t support this property or method”
for(iCount=0;iCount<newData.length;iCount++)
{
fldCombo.length +=1
strText=newData[iCount]
if (strText !=undefined && strText != null)
{
fldCombo[fldCombo.length-1].text = trim(strText)
}
}
}
// To remove duplicate entries from dbcolumn
function getUniqueValues(mixedData)
{
mixedData = mixedData.sort();
idx = 0;
prevValue = mixedData[0];
currValue = mixedData[0];
for (i=0; i<mixedData.length; i++)
{
currValue = mixedData[i];
if (currValue != prevValue)
{
idx++;
count=idx
}
uniqueValues[idx] = currValue;
prevValue = currValue;
}
return uniqueValues
}
===========================
Thanks in Advance,
SANJAY
One more query How can we unhide a row without refreshing the form using JS. Awaiting your kind reply. Thanks and RegardsSanjay