For Customizing field lookup In EnterPrise Portal

Hi,
I need to modified field lookup in EP.
tried below code but range is not working for that.

void dataSetLookup(SysDataSetLookup sysDataSetLookup)
{
List list;
;

list = new List(Types::String);
list.addEnd(fieldstr(TABLENAME, FIELDNAME));
sysDataSetLookup.parmLookupFields(list);
sysDataSetLookup.parmSelectField(enum2str(fieldnum(TABLENAME, FIELDNAME)));
sysDataSetLookup.parmQuery().addDataSource(tablenum(TABLENAME)).addRange(fieldnum(TABLENAME,ENUMFIELD)).value(enum2str(ENUMFIELD::ENUMVALUE));
}

can anybody suggest for that?