Hi All,
How to get a lookup on form column with reference to the aother column on the form.
public void lookup(FormControl _formControl, str _filterStr) { Query query = new Query(); QueryBuildDataSource queryBuildDataSource; QueryBuildRange queryBuildRange; QueryBuildRange queryBuildRange1; SysTableLookup sysTableLookup; QueryBuildFieldList QueryBuildFieldList; Esp_Modules modules; ; //Create an instance of SysTableLookup with the form control passed in sysTableLookup = SysTableLookup::newParameters(tablenum(Esp_Modules), _formControl); //Add the fields to be shown in the lookup form sysTableLookup.addLookupfield(fieldnum(Esp_Modules, ModuleId)); sysTableLookup.addLookupfield(fieldnum(Esp_Modules, Name)); sysTableLookup.addLookupfield(fieldnum(Esp_Modules, CertificationId)); // sysTableLookup.addLookupfield(fieldnum(Esp_Modules, Name)); //create the query datasource queryBuildDataSource = query.addDataSource(tablenum(Esp_Modules)); //Only show LocalEndpoints for the current company queryBuildRange = queryBuildDataSource.addRange(fieldnum(Esp_Modules, ModuleId)); while select ModuleId from modules where modules.CertificationId == Esp_Certifications_Module.CertificationId //SalaryAmend.GridId is the FormTable.Fild1 //queryBuildRange.(modules.ModuleId); queryBuildRange.value(modules.ModuleId); //this select query makes the queryBuildRange values from another table for the datasource of another table //Assign the query to the lookup form sysTableLookup.parmQuery(query); // Perform lookup sysTableLookup.performFormLookup(); // Don't call super() //super() }
Column CertificationName is selected then CertificationId will populate automatically which is working fine , but the Module Id is not populating according to CertificationId.
How to get this ModuleId field Lookup related to CertificationId?
Thanks and regards
Siddhant Singh