fernandolk_1992 Posted January 3, 2022 Topic Count: 19 Topics Per Day: 0.02 Content Count: 52 Content Per Day: 0.05 Reputation: 5 Achievement Points: 425 Solved Content: 0 Days Won: 3 Status: Offline Device: Windows Report Posted January 3, 2022 Bom dia. Estou tentando alterar o atendente no Agilis através de consulta SQL + formula, porem não estou tendo sucesso. Segue a Consulta SQL: SELECT A.CODATENDENTE as ATENDENTE FROM HATENDENTE A JOIN MPRJCOMPL MPRJC ON MPRJC.ENGENHEIRO_RESIDENTE = A.CODATENDENTE JOIN MPRJ M ON MPRJC.IDPRJ = M.IDPRJ JOIN TMOV T ON M.CODCCUSTO = T.CODCCUSTO JOIN TMOVATEND ATEND ON T.IDMOV = ATEND.IDMOV WHERE ATEND.CODATENDIMENTO = :FRM_IDREQ AND M.CODCCUSTO = T.CODCCUSTO O campo MPRJC.ENGENHEIRO_RESIDENTE é um campo complementar onde fiz um lookup na tabela de cadastro de atendente. Esse campo foi feito na tela de cadastro de projetos e cada projeto pode ter um atendente diferente. Formula: DECL ATENDENTE; SE EXECSQL('EL.ENGRES') =1 ENTAO SETVAR (ATENDENTE, RESULTSQL('EL.ENGRES','ATENDENTE')); Em resumo, preciso que o atendente do chamado seja o mesmo atendente que está no campo MPRJC.ENGENHEIRO_RESIDENTE. Usando a consulta SQL eu consigo pegar o código do atendente porem não sei como fazer a alteração na tabela de atendimentos. Quote
Luciano Rodrigues Posted March 16, 2022 Topic Count: 0 Topics Per Day: 0 Content Count: 8 Content Per Day: 0.00 Reputation: 1 Achievement Points: 41 Solved Content: 0 Days Won: 1 Status: Offline Age: 36 Report Posted March 16, 2022 Para repassar um atendimento o retorno da fórmula tem que ser: CODCOLIGADA;CODATENDENTE. Quote
fernandolk_1992 Posted April 1, 2022 Topic Count: 19 Topics Per Day: 0.02 Content Count: 52 Content Per Day: 0.05 Reputation: 5 Achievement Points: 425 Solved Content: 0 Days Won: 3 Status: Offline Device: Windows Author Report Posted April 1, 2022 Obrigado pelo retorno @Luciano Rodrigues, porem já consegui fazer o que preciso hehe... Foi um pouco mais complexo do que usar as formulas padrões do sistema. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.