Raphael Gomes Posted June 12, 2024 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 Report Posted June 12, 2024 (edited) Bom dia, Poderiam me auxiliar com o seguinte erro na fórmula visual? At., Raphael. informacaoOrdemCompra.TotvsWF Edited June 12, 2024 by Raphael Gomes Quote
caiiomonteiro Posted June 12, 2024 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 Report Posted June 12, 2024 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 2 - Na sua consulta SQL dentro do código c# você precisa retornar no SELECT o IDLAN que esta utilizando para buscar no dataset Quote
Raphael Gomes Posted June 12, 2024 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 Author Report Posted June 12, 2024 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 2 - Na sua consulta SQL dentro do código c# você precisa retornar no SELECT o IDLAN que esta utilizando para buscar no dataset 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(); } Quote
caiiomonteiro Posted June 12, 2024 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 Report Posted June 12, 2024 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 Quote
Raphael Gomes Posted June 12, 2024 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 Author Report Posted June 12, 2024 Apareceu um erro diferente será o que pode ser? Quote
caiiomonteiro Posted June 12, 2024 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 Report Posted June 12, 2024 Algum problema na sintaxe da sua consulta SQL antes do GROUP BY Quote
Raphael Gomes Posted June 13, 2024 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 Author Report Posted June 13, 2024 Bom dia, Consegui resolver esse. Agora, em outra fórmula visual, estou com outro erro: nomeSolicitante.TotvsWF Quote
caiiomonteiro Posted June 13, 2024 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 Report Posted June 13, 2024 (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 Edited June 13, 2024 by caiiomonteiro . Quote
Raphael Gomes Posted June 13, 2024 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 Author Report Posted June 13, 2024 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 Muito obrigado pela ajuda. Funcionou depois do ajuste! 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.