I have a simple text doc with 1 column of data, multiple rows
I wish to import this into a drop down
At the moment, I am just trying to read the text file and populate 1 text field with any one row of data
The text field's name is Main.Pg1.zProjectID
Do I need to have this full name in the Txt data file? or just zProjectID????
The Trusted function executes, but does not update the field?
The import button script is as follows:
var myFPathName = "/c/temp/myData.txt";
var myRow = "0";
console.println("myFPath. " + myFPathName );
myImportProjects2(event.target, myFPathName, myRow); // call the priv function
The Trusted Function is as follows:
var myImportProjects = app.trustedFunction(function(oDoc,cPath,cRow)
{
app.beginPriv();
try
{
console.println("Data Import.");
oDoc.importTextData(cPath, cRow);
app.alert("Text Imported:\n" + cPath);
}
catch(e)
{
app.alert("Error During import of Project Text Data.\n" + e);
console.println("Error Text Data Import.\n" + e);
}
app.endPriv();
});
And my text file looks like this
"Main.Pg1.zProjectID"
"12"
"103"
Can anyone shed some suggestions as to what I am doing wrong?
1. Instead of passing a string for the row number("0"), pass a number (0).
2. Get the return value of the importTextData method and let us know what it is.
3. If your catch clause is getting triggered, examine the other properties of the error object to give you more clues.