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

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:  36

Posted

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

 

  • 3 weeks later...

  • 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

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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