FINA018 (Atualização de Índice) - Rotina Automática.
Exemplos de como usar as opções de inclusão e exclusão pela rotina automática, da Atualização de Índice (FINA018)
USER FUNCTION FIN018INC()
LOCAL aArray := {}
PRIVATE lMsErroAuto := .F.
DbSelectArea("FIU")
dbSetOrder(1)
aArray := { { "FIU_DATA" , dDataBase, NIL },;
{ "FIU_CODIND" , "01" , NIL },;
{ "FIU_INDICE" , 20 , NIL },;
{ "FIU_BLOQ" , "2" , NIL }}
MsExecAuto( { |x,y| FINA018(x,y)} , aArray, 3)
If lMsErroAuto
MostraErro()
Else
Alert("Atualização concluída")
Endif
Return
USER FUNCTION FIN018EXC()
LOCAL aArray := {}
PRIVATE lMsErroAuto := .F.
DbSelectArea("FIU")
DbSeek(xFilial("FIU")+DtoS(dDataBase))
aArray := { { "FIU_DATA" , FIU->FIU_DATA , NIL } }
MsExecAuto( { |x,y| FINA018(x,y)} , aArray, 5)
If lMsErroAuto
MostraErro()
Else
Alert("Registro Excluído!")
Endif
Return