//-------------------------------------------------------------------- // Ponto de Entrada: Gerar registro automático quando alterada // a data fim da Oportunidade. // Solicitante: Marcia // Autor: Aytel Marcello Fonseca. // Data: 22.03.2021 //-------------------------------------------------------------------- #include 'protheus.ch' #include 'rwmake.ch' #include "topconn.ch" #include "totvs.ch" User Function FT300AGR() Local aArea := GetArea() If Altera .AND. (M->AD1_DTFIM <> AD1->AD1_DTFIM) If !isBlind() MsgInfo('Alterada a Data Fim da Oportunidade. Será gerado, automaticamente, registro na Etapas da Oportunidade.','Informação.') Endif // Gravar Z41. RecLock("Z41",.T.) Z41_FILIAL := Trim(cFilAnt) Z41_DATA := DDATABASE Z41_HORA := LEFT(TIME(),5) Z41_HISTOR := "ALTERAÇÃO DATA FIM. DE: " + DToC(AD1->AD1_DTFIM) + " PARA: " + DToC(M->AD1_DTFIM) + "." Z41_USUARI := Trim(cUserName) Z41_OPORT := AD1_NROPOR MsUnlock() EndIf RestArea(aArea) Return(.T.)