public static Map<String, String> getLookupValue(String lookupName)
{
tcLookupOperationsIntf lookupOpsIntf = null;
Map<String, String> lookupValues = new HashMap<String, String>();
tcResultSet lookupResSet = null;
String lookupCode;
String lookupValue;
try
{
lookupOpsIntf=Platform.getService(tcLookupOperationsIntf.class);
lookupResSet = lookupOpsIntf.getLookupValues(lookupName);
if ((lookupResSet != null) && (lookupResSet.getRowCount() > 0))
{
for (int i = 0; i < lookupResSet.getRowCount(); i++)
{
lookupResSet.goToRow(i);
lookupCode = lookupResSet.getStringValue(Constants.LKV_ENCODED);
lookupValue =lookupResSet.getStringValue(Constants.LKV_DECODED);
lookupValues.put(lookupCode, lookupValue);
}
}
}
catch (tcInvalidLookupException invalidLookupEx)
{
//print Exceptions
}
catch (Exception e)
{
//print Exceptions
}
finally
{
if (lookupOpsIntf != null)
{
lookupOpsIntf.close();
}
}
return lookupValues;
}
{
tcLookupOperationsIntf lookupOpsIntf = null;
Map<String, String> lookupValues = new HashMap<String, String>();
tcResultSet lookupResSet = null;
String lookupCode;
String lookupValue;
try
{
lookupOpsIntf=Platform.getService(tcLookupOperationsIntf.class);
lookupResSet = lookupOpsIntf.getLookupValues(lookupName);
if ((lookupResSet != null) && (lookupResSet.getRowCount() > 0))
{
for (int i = 0; i < lookupResSet.getRowCount(); i++)
{
lookupResSet.goToRow(i);
lookupCode = lookupResSet.getStringValue(Constants.LKV_ENCODED);
lookupValue =lookupResSet.getStringValue(Constants.LKV_DECODED);
lookupValues.put(lookupCode, lookupValue);
}
}
}
catch (tcInvalidLookupException invalidLookupEx)
{
//print Exceptions
}
catch (Exception e)
{
//print Exceptions
}
finally
{
if (lookupOpsIntf != null)
{
lookupOpsIntf.close();
}
}
return lookupValues;
}
This comment has been removed by the author.
ReplyDeleteNice Code...It Helped me :) Thanks for sharing
ReplyDelete