Saltar al contenido principal

Filter button created to make the filter on the FORM

Respondida

Comentarios

2 comentarios

  • Comentario oficial
    Martin Heigl

    Hi Filipe

    you don't need the GLOBAL FUNCTION FormClose
    You can define the filter always only 1 time. With next definition you overwrite the other filter definition

    Idea:

    Create the filter string and then set it

     

    declare=lform=ue_form

    lform.dwname=FiltrarOperação
    lform.sql=select space(30) rota1, space(30) rota2, space(30) rota3, space(30) rota4, space(30) rota5, space(30) rota6, space(30)rota7, space(30) rota8, space(30) rota9 from "BEAS_DUMMY"
    lform.dw_1.item.Rota1.title=Rota 1
    lform.dw_1.item.Rota2.title=Rota 2
    lform.dw_1.item.Rota3.title=Rota 3
    lform.dw_1.item.Rota4.title=Rota 4
    lform.dw_1.item.Rota5.title=Rota 5
    lform.dw_1.item.Rota6.title=Rota 6
    lform.dw_1.item.Rota7.title=Rota 7
    lform.dw_1.item.Rota8.title=Rota 8
    lform.dw_1.item.Rota9.title=Rota 9
    lform.style=edit
    lform.showdialog

    // create filter string
    setvar=ls_filter=
    if <lform.rota1> <> "" then
    addvar=ls_filter= or item.ag01='<lform.rota1>'
    end if
    if <lform.rota2> <> "" then
    addvar=ls_filter= or item.ag01='<lform.rota2>'
    end if
    // same for all other


    if <ls_filter> <> "" then
    // messagebox=<ls_filter,mid 4>
    // now set filter without first "or"
    dw_1.setfilter=<ls_filter,mid 4>
    end if
    destroy=lform

  • Filipe
    thank you it worked!

Iniciar sesión para dejar un comentario.