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:  12
  • Topics Per Day:  0.01
  • Content Count:  46
  • Content Per Day:  0.05
  • Reputation:   8
  • Achievement Points:  315
  • Solved Content:  0
  • Days Won:  1
  • Status:  Offline
  • Device:  Windows

Posted (edited)

Bom dia,

Poderiam me auxiliar com o seguinte erro na fórmula visual?

image.png.f3c83d6726444a9770b5ad986bd51a37.png

At.,

Raphael.

informacaoOrdemCompra.TotvsWF

Edited by Raphael Gomes
  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images


  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  164
  • Content Per Day:  0.06
  • Reputation:   65
  • Achievement Points:  1,066
  • Solved Content:  0
  • Days Won:  26
  • Status:  Offline
  • Age:  27
  • Device:  Windows

Posted

Bom dia @Raphael Gomes, beleza ?

1 - na atividade para criar a coluna falta dois parâmetros, a tabela onde será criado a coluna e o tipo do campo

image.png

 

2 - Na sua consulta SQL dentro do código c# você precisa retornar no SELECT o IDLAN que esta utilizando para buscar no dataset

image.png


  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  46
  • Content Per Day:  0.05
  • Reputation:   8
  • Achievement Points:  315
  • Solved Content:  0
  • Days Won:  1
  • Status:  Offline
  • Device:  Windows

Posted
52 minutos atrás, caiiomonteiro disse:

Bom dia @Raphael Gomes, beleza ?

1 - na atividade para criar a coluna falta dois parâmetros, a tabela onde será criado a coluna e o tipo do campo

image.png

 

2 - Na sua consulta SQL dentro do código c# você precisa retornar no SELECT o IDLAN que esta utilizando para buscar no dataset

image.png

Obrigado pelas informações. Funcionou perfeitamente após as alterações. Se eu quiser passar como parâmetro a coligada ficaria dessa forma abaixo?

 

public void CustomDataServer(RM.Con.SourceCode.Intf.SrcDataServerParams dataServerParams)
    {
      string strParametro = "";
      string strCodColigada = "";
      
      foreach(DataRow lancamento in dataServerParams.DataSet.Tables["FLAN"].Rows)
      {
        strParametro += lancamento["IDLAN"].ToString() + ", ";
        strCodColigada = lancamento["CODCOLIGADA"].ToString();
      }
      
      string strSentenca =@"SELECT 
     
     STRING_AGG('Nº.:'+TMOV1.NUMEROMOV + '  -  ' + CONVERT(CHAR(10),TMOV1.DATACRIACAO,103)  , ', ') AS NROOC,
     FLAN.IDLAN
     
     FROM FLAN (NOLOCK)

     LEFT JOIN TMOV (NOLOCK) 
     ON FLAN.CODCOLIGADA = TMOV.CODCOLIGADA AND FLAN.IDMOV = TMOV.IDMOV

     LEFT JOIN TMOVRELAC (NOLOCK) 
     ON TMOV.CODCOLIGADA = TMOVRELAC.CODCOLDESTINO AND TMOV.IDMOV = TMOVRELAC.IDMOVDESTINO

     LEFT JOIN TMOV TMOV1 (NOLOCK) 
     ON TMOVRELAC.CODCOLORIGEM = TMOV1.CODCOLIGADA AND TMOVRELAC.IDMOVORIGEM = TMOV1.IDMOV

     WHERE FLAN.IDLAN IN ("+ strParametro + " 0) AND FLAN.CODCOLIGADA = "+ strCodColigada +" GROUP BY FLAN.IDLAN";

     
     DataTable dtRetorno = DBS.QuerySelect(string.Empty, strSentenca);
     
     foreach(DataRow lancamento in dataServerParams.DataSet.Tables["FLAN"].Rows)
      {
        DataRow[] rowRetorno = dtRetorno.Select("IDLAN = " + lancamento["IDLAN"].ToString());
        
        lancamento["Informações Ordem de Compra"] = rowRetorno[0]["NROOC"].ToString();
      
      }


  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  164
  • Content Per Day:  0.06
  • Reputation:   65
  • Achievement Points:  1,066
  • Solved Content:  0
  • Days Won:  26
  • Status:  Offline
  • Age:  27
  • Device:  Windows

Posted

Isso mesmo

Outra opção é pegar a coligada do contexto. Deixo duas opções abaixo com e sem variável.

1 - Utilizando a variável -> int codColigada = dataServerParams.Context.CodColigada;

2 - Não utilizando a variável -> na consulta SQL ficaria FLAN.CODCOLIGADA = :CODCOLIGADA e na hora de executar a consulta você passa como parâmetro no DBS.QuerySelect

image.png


  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  46
  • Content Per Day:  0.05
  • Reputation:   8
  • Achievement Points:  315
  • Solved Content:  0
  • Days Won:  1
  • Status:  Offline
  • Device:  Windows

Posted

Apareceu um erro diferente será o que pode ser?

image.png.5c32965110116a044853bdcd34884db2.png


  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  164
  • Content Per Day:  0.06
  • Reputation:   65
  • Achievement Points:  1,066
  • Solved Content:  0
  • Days Won:  26
  • Status:  Offline
  • Age:  27
  • Device:  Windows

Posted

Algum problema na sintaxe da sua consulta SQL antes do GROUP BY


  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  46
  • Content Per Day:  0.05
  • Reputation:   8
  • Achievement Points:  315
  • Solved Content:  0
  • Days Won:  1
  • Status:  Offline
  • Device:  Windows

Posted

Bom dia,

Consegui resolver esse. Agora, em outra fórmula visual, estou com outro erro:

image.png.8e4184f4a07c79d3b2c3776b8dd51302.png

nomeSolicitante.TotvsWF


  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  164
  • Content Per Day:  0.06
  • Reputation:   65
  • Achievement Points:  1,066
  • Solved Content:  0
  • Days Won:  26
  • Status:  Offline
  • Age:  27
  • Device:  Windows

Posted (edited)

O problema pode estar relacionado há algum alinha existente na tabela "FLAN" que não está retornando na sua consulta SQL

Como você está criando a coluna na tela de lançamentos financeiro, sugiro você inverter a sintaxe na sua consulta, buscando os dados da FLAN e fazendo o LEFT JOIN com a TMOV

image.png

Edited by caiiomonteiro
.

  • Topic Count:  12
  • Topics Per Day:  0.01
  • Content Count:  46
  • Content Per Day:  0.05
  • Reputation:   8
  • Achievement Points:  315
  • Solved Content:  0
  • Days Won:  1
  • Status:  Offline
  • Device:  Windows

Posted
4 horas atrás, caiiomonteiro disse:

O problema pode estar relacionado há algum alinha existente na tabela "FLAN" que não está retornando na sua consulta SQL

Como você está criando a coluna na tela de lançamentos financeiro, sugiro você inverter a sintaxe na sua consulta, buscando os dados da FLAN e fazendo o LEFT JOIN com a TMOV

image.png

Muito obrigado pela ajuda. Funcionou depois do ajuste!

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.