FSoftware Posted April 25 Share Posted April 25 Olá, bom dia ! Estou tentando cancelar nfce pela chave e estou recebendo sempre o mesmo erro : list index out of bounds (0). Se alguém puder ajudar. Obrigado. ACBrNFe.Configuracoes.Geral.ModeloDF := moNFCe; ACBrNFe.EventoNFe.Evento.Clear; with ACBrNFe.EventoNFe.Evento.New do begin infEvento.chNFe := sChave; infEvento.CNPJ := CNPJ; infEvento.dhEvento := now; infEvento.tpEvento := teCancelamento; infEvento.detEvento.xJust := Justificativa; infEvento.detEvento.nProt := Protocolo; end; ACBrNFe.EnviarEvento(StrToInt(idLote)); Link to comment Share on other sites More sharing options...
Moderadores BigWings Posted April 25 Moderadores Share Posted April 25 No programa exemplo do componente também ocorre o problema? BigWingsAjude o Projeto ACBr crescer - Assine o SAC Link to comment Share on other sites More sharing options...
FSoftware Posted April 25 Author Share Posted April 25 Não, realizei o teste no exemplo e esta funcionando normalmente. Link to comment Share on other sites More sharing options...
Moderadores Solution BigWings Posted April 25 Moderadores Solution Share Posted April 25 4 minutos atrás, FSoftware disse: Não, realizei o teste no exemplo e esta funcionando normalmente. Isso indica que é algo na sua rotina, precisa debugar e encontrar o erro. Geralmente é quando você tenta acessar um item de uma lista sem testar antes, por exemplo: ACBrNFe.NotasFiscais[0] // vai dar o erro se não tiver nada na lista Trocar para: if ACBrNFe.NotasFiscais.Count > 0 then ACBrNFe.NotasFiscais[0]... BigWingsAjude o Projeto ACBr crescer - Assine o SAC Link to comment Share on other sites More sharing options...
FSoftware Posted April 25 Author Share Posted April 25 (edited) Entendi. Mas são funções (cancelar e consultar pela chave) que estão a mais de ano em funcionamento e recentemente começou aparecer esse problema, mas vou verificar. Muito obrigado pela ajuda. Edited April 25 by FSoftware Link to comment Share on other sites More sharing options...
Moderadores Renato Rubinho Posted April 25 Moderadores Share Posted April 25 Veja o onStatusChange, esses dias o próprio BigWings matou a charada de outra pessoa que estava com problema semelhante e era no evento. Link to comment Share on other sites More sharing options...
FSoftware Posted April 25 Author Share Posted April 25 Resolvido, limpando e carregando novamente as configurações do componente ACBrNFe voltou funcionar. Mas obrigado Renato pela força. Link to comment Share on other sites More sharing options...
Moderadores Renato Rubinho Posted April 25 Moderadores Share Posted April 25 Obrigado por reportar. Fechando. Para novas dúvidas, criar um novo tópico. Link to comment Share on other sites More sharing options...
Recommended Posts