Description

The entry point ADMSELFIL was implemented to replace the standard branch selection screen presented by the function AdmOpcoes(), so that the user can choose the desired branches without a screen, or create their own screen for branch selection. Specialization to meet the sigamat model "EE|FF".


Entry Point

Description:

The entry point ADMSELFIL will be executed whenever the function AdmGetFil() is used and will allow the user to select the branches in the desired way, via screen or without a graphical interface.

Location:

All Adm routines that address corporate management. Example: FINA241, FINR130, ATFA450, ATFR070, CTBR400.

Events:

Select Branches? question

Source Program:

AdmXFun.PRW

Function:

AdmGetFil()

Return:

Name

Type

Description

Required

 aRet

Array

Contains the selected branches.

Yes

Note: If the routine performs a search for the function AdmSelecFil() or FwSelectGC() to use them instead of AdmGetFil(), the entry point will not be executed.

Example:

#Include 'Protheus.ch'


User Function ADMSELFIL()


Local cTitle := ParamIxb[1]  // Used for screen assembly, if desired.

Local aOpcs  := ParamIxb[2] // Array containing branch, company name, and CGC (CNPJ/Tax ID

Local cOpcs  := ParamIxb[3] // aOpcs macro-executed, storing only the branch code

Local nTamFil:= ParamIxb[4] // Branch size

Local aRet   := {}                 // Return of the selected branches

Local nI     := 0


Alert("Entry point ADMSELFIL executed")


If MsgYesNo("Do you want to select all branches?")

      For nI := 1 to Len(aOpcs)

            AADD(aRet, PadR(aOpcs[nI][1], nTamFil) )

      Next

Else

      For nI := 1 to Len(aOpcs)

            If MsgYesNo("Do you want to select the branch ( "+aOpcs[nI][2]+" ) ?")

                  AADD(aRet, aOpcs[nI][1])

                  MsgAlert("Branch "+aOpcs[nI][2]+" select.")

            EndIf

      Next

      If Empty(aRet)

            aRet := cFilAnt

      EndIf

EndIf


Return aRet