Filters in the Web Panel

Asked

Viewed 62 times

1

I made an application to manage all the IT equipment in a company, I can list how many of each type of equipment there are in total, and I can also show only one specific type, like laptops or desktops, but I can’t make a list showing how many laptops or printers I have in a certain branch. (I will attach prints). I would like that when I typed the name of a certain branch in the second field, only the equipment of that branch appeared.

This is the code for my Event Load in the Web Panel in the Events tab

Event Load
    &EquipQtn = count(Nome_Equipamento)
    &FilialStartCheck = (Nome_Filial)
EndEvent    

That’s my Grid code on the Web Panel

TipoEquipamentoNome like '%'+&EquipStartCheck.Trim()+'%';
Nome_Filial like '%'+&FilialStartCheck.Trim()+'%';

Listagem

1 answer

0

The first question to check is whether this GRID is based on attributes or variables only. When the GRID is based on attribute the LOAD event runs per line, when the GRID is based on variables only the LOAD event runs only once, this should be taken into account in your For each.

There are some ways to perform Count conditionally. You can do a for each manually by filtering the branch, or even fetch this value from a previous or a previous date. I’d do it this way:

Event Load
&count.SetEmpty()
For Eeach
    where Nome_Filial like '%'+&FilialStartCheck.Trim()+'%' WHEN not &FilialStartCheck.IsEmpty()

   &count += 1
EndFor
&EquipQtn = &count
&FilialStartCheck = (Nome_Filial) 
EndEvent

Any doubt just comment.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.