Jump to content
Seja Membro VIP - Remova Banners de Propagandas, Tenha Liberado Qualquer Download, Além de Acessos em Áreas Exclusivas!! ×

Recommended Posts


  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  59
  • Content Per Day:  0.04
  • Reputation:   7
  • Achievement Points:  482
  • Solved Content:  0
  • Days Won:  3
  • Status:  Offline
  • Device:  Windows

Posted

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.

 

  • 2 months later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic


  • 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:  37

Posted

Para repassar um atendimento o retorno da fórmula tem que ser: CODCOLIGADA;CODATENDENTE.

 

  • 3 weeks later...

  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  59
  • Content Per Day:  0.04
  • Reputation:   7
  • Achievement Points:  482
  • Solved Content:  0
  • Days Won:  3
  • Status:  Offline
  • Device:  Windows

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.