I have created two fields in which if i select country the state should get filter according to that country , so if i select country of final destination as "ITA" then the port of loding only show the value of port from italy , but its showing value from all countries , how can apply filter from this , my code is below.


[FormControlEventHandler(formControlStr(SalesTable, SalesOrderExim_PortOfLoading), FormControlEventType::Lookup)]
public static void SalesOrderExim_PortOfLoading_OnLookup(FormControl sender, FormControlEventArgs e)
{
Query query;
SysTableLookup sysTableLookup;
QueryBuildDataSource queryBuildDataSource;
query = new Query();
sysTableLookup = SysTableLookup::newParameters(tableNum(dev_PortTbl), sender);
queryBuildDataSource qbdsdev_PortTbl = query.addDataSource(tableNum(dev_PortTbl));
sysTableLookup.addLookupfield(fieldNum(dev_PortTbl,Port));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}