CodeChargeMVP
Posts: 473
|
Posted: 06/28/2011, 1:57 AM |
|
Hi,
I�m working over a normal record grid form,
the grid is showing the next fields:
IdJMP, IdMP, JMPPor, JMPImpGasto, JMPDivCod, JMPImpEuros
Our customer wants to see a description instead of the field IdMP which is a foreign key to
another table where the description is stored,so then on the before build select I try:
global $jg_mp1;
global $JMPProRef;
global $IdJG;
$JMPProRef = $jg_mp1->JMPProRef->Value;
$IdJG = $jg_mp1->IdJG->Value;
if($JMPProRef == "RS"){
$jg_mp->DataSource->SQL = "SELECT IdJMP, IdMP, JMPPor, JMPImpGasto, JMPDivCod, JMPImpEuros, resultados.ResDesc FROM jg_mp INNER JOIN resultados ON jg_mp.IdMP = resultados.IdRes WHERE IdJG ="."'".$IdJG."'"."ORDER BY IdJMP";
}else if($JMPProRef == "AC"){
}else if($JMPProRef == "OE"){
}
As you see,my idea is to create a different datasource depending on a variable value,
I create the new datasource, but obviously, there�s somenthing I miss, cause when
I do the new datasource on the before build select, than I can�t go to design view select
the field IdMP and choose his new ControlSource resultados.ResDesc,
�how do I put the new queryresult resultados.ResDesc on the field grid IdMP?
Thank you very much in advance.
_________________
Best Regards
Entrepeneur | NT Consultant
|
|
|
CodeChargeMVP
Posts: 473
|
Posted: 06/28/2011, 4:04 AM |
|
hi,
I know I�ve to do somenthing like:
$jg_mp->IdMP->SetValue();
But the question is �How do catch the new value ResDesc from the datasource?
When I´m trying $jg_mp->DataSource-> I only see avalaible the originals fields from the original visual query builder.
_________________
Best Regards
Entrepeneur | NT Consultant
|
|
|
|