Solved

Enable search in EE client form

  • 24 October 2022
  • 3 replies
  • 81 views

Userlevel 3
Badge +8

Can we enable the search button of a form according to inner table of it?

 

I need to enable the search and give the facility to search by upper table columns.

icon

Best answer by kavinduxo 28 October 2022, 09:35

View original

3 replies

Userlevel 1
Badge +4

Hi Kavin, 

 

Do you mean the below? 

 

You can Right Mouse Button in any form and select the search in context option this will open the search dialogue for the table.  

 

 

 

 

Userlevel 3
Badge +8

Hi @CODUGBHW ,

That’s an option I have already suggested. But customer wants to have the search button to work.

 

BR,

@kavinduxo 

Userlevel 3
Badge +8

Happy to share that I manage to do this requirement. The steps below show the way  I achieve it.

  1. I added the same lu, view and package name for the frm window as i see in tbw window. 
  2. Then added the key columns and few columns(those i need to see in search) to main frm window from uppder tbw window.
  3. Override the vrtDataSourcePopulateIt method in frm window. 
public override SalBoolean vrtDataSourcePopulateIt(SalNumber nParam)
{
if (Sys.wParam == Ifs.Fnd.ApplicationForms.Const.METHOD_Execute)
{
userWhere = this.i_lsUserWhere;
orderBy = this.i_sUserOrderBy;
}

return base.vrtDataSourcePopulateIt(nParam);
}
  1. Override the vrtDataSourcePopulateIt in tbw window.
public override SalBoolean vrtDataSourcePopulateIt(SalNumber nParam)
{
SalString lsUserWhere = "";
SalString sOrderby = "";

if (Sys.wParam == Ifs.Fnd.ApplicationForms.Const.METHOD_Execute)
{
if (this.i_lsUserWhere != "")//Sys.STRING_Null)
{
lsUserWhere = this.i_lsUserWhere + " AND " + ((frmCmodPartAdmin)this.GetParent()).userWhere;
}
else
{
lsUserWhere = ((frmCmodPartAdmin)this.GetParent()).userWhere;
}
this.i_lsUserWhere = lsUserWhere;

if (this.i_sUserOrderBy != "")//Sys.STRING_Null)
{
sOrderby = this.i_sUserOrderBy;
}
else
{
sOrderby = ((frmCmodPartAdmin)this.GetParent()).orderBy;
}
this.i_sUserOrderBy = sOrderby;

}
#region Variables

return base.vrtDataSourcePopulateIt(nParam);
//return nRet;
#endregion
}
  1. This will be enough if the form is a read-only window. If you need to enable save, remove and edit, add the following code on windows action of tbw window. See the code snippet below.
private void tbwCmodPartAdministration_WindowActions(object sender, WindowActionsEventArgs e)
{
#region Actions
switch (e.ActionType)
{
case Ifs.Fnd.ApplicationForms.Const.PM_DataRecordNew:
Sal.SendClassMessage(Ifs.Fnd.ApplicationForms.Const.PM_DataRecordNew, Sys.wParam, Sys.lParam);
if (Sys.wParam == Ifs.Fnd.ApplicationForms.Const.METHOD_Execute)
{
frmCmodPartAdmin.FromHandle(i_hWndParent)._DataSourceStateSetDirty(true, 1);
}
break;

}
#endregion
}

 

Thanks,

Kavindu

Reply