Hello,
Hope all are fine.
I am facing issue to set a condition on lookup selecting. Lookup Select field is in detail table and filter field is in master table. In my case if parent field value is finished_fabric then value will get from delstore_summery table otherwise value will get from gray_requisition_details table. I placed the below code on Table Specific-> Lookup_Selecting:
if (($this->isGridAdd()) && ($fld->Name == "grd_batch_no")) {
if (Container("deliveryhub")->delivery_type->FormValue == "finished_fabric") {
$fld->Lookup->UseLookupCache = false;
$fld->Lookup->UserSelect = "SELECT grd_batch_no AS lf, grd_batch_no AS df, 'Finished Fabric' AS pf FROM delstore_summery";
}
else {
$fld->Lookup->UseLookupCache = false;
$fld->Lookup->UserSelect = "SELECT grd_batch_no AS lf, grd_batch_no AS df, 'Grey Fabric' AS lf FROM gray_requisition_details";
}
}
As I am setting this lookup for ADD form, so there are possibilities of not available field value initially. But after choosing parent field value this lookup also not executing expected query. All time lookup is giving option from second part (SELECT grd_batch_no AS lf, grd_batch_no AS df, 'Grey Fabric' AS lf FROM gray_requisition_details";);
I think there are problems to get value from Container("deliveryhub")->delivery_type->FormValue. Can experts suggest me to solve this issue?
Thanks in Advance.