Java Code - What am I doing wrong, cannot get values from DocContext

I am trying to retrieve values from a. the INI file

b. from Notes Document selected in the view

But the code prints blanks, I have identified the failure lines and working line.

What am I doing wrong

Thanx

Yazdi

// trying to retrieve an INI variable

// in ini file set as

// My_server=http://192.168.01/folder_1/filename.dll

String urlstart = session.getEnvironmentString(“My_webserver”, true); //FAILS

System.out.println(“URLstart :” + urlstart);

// getting field from document

double msgid = doc.getItemValueDouble(“MY_MSGID”); // FAILS - FIELD is NUMBER and EXISTS

System.out.println(“MSGID :” + msgid);

// getting field from document

double dbid = doc.getItemValueDouble(“my_DBID”); // FAILS - FIELD IS NUMBER and EXISTS

System.out.println(“DBID :” + dbid);

THIS LINE WORKS as my_MD5 is a string field

// getting field from document

String hash=doc.getItemValueString(“my_MD5”); // WORKS

System.out.println(“HASH :” + hash);

Subject: Java Code - What am I doing wrong, cannot get values from DocContext

I vaguely recall having the environment variable problem too. It seems like it was only for remote programs. I can’t remember how (or if) I got around it at the moment though. As for the other problem, I would suggest that you re-check your datatypes . . . try something like this:

Vector avecFldVals = null;

avecFldVals = doc.getItemValue(“MY_MSGID”);

for (Enumeration e = avecFldVals.elements(); e.hasMoreElements() :wink: {

System.out.println(e.nextElement().getClass().getName());

}

avecFldVals = doc.getItemValue(“my_DBID”);

for (Enumeration e = avecFldVals.elements(); e.hasMoreElements() :wink: {
System.out.println(e.nextElement().getClass().getName());

}