Bom Dia! Estou com um problema que é o seguinte!
Tanho um formulario com informaçoes, e dentre uma delas um valor, eles são enviados para o banco de dados, e gostaria que fosse somado ESTE VALOR, toda vez que for enviado, e der o resultado na tela! Como pode ser feito isto?
Hi Paulo,
First of all, I advise you to use English as the language here in the Forum, that will allow any user to help you with your issue.
Second, I also advise you to go to the Learn section and check out the lessons available there.
Nuno Rolo escreveu:
Oi paulo
Antes de tudo, recomendo que você use o inglês como idioma aqui no fórum, o que permitirá a qualquer usuário ajudá-lo com seu problema.
Segundo, também aconselho que você vá para a seção Aprender e confira as lições disponÃveis lá.
Eu já fiz o Learning, mas não conseguindo resolver esta questão, você poderia me ajudar?
Paulo,
I don't know how you have that implemented so it's hard to give the best inputs. You may need to have a specific query or action to retrieve that information and after you insert the new information in the database you will need to refresh that query and UI widget in order to show. But with that simple print, it's hard to provide more guidance.
When you click a Button with method submit, the data the user input is submitted to the server and will be available for you to do whatever you want with.
My suggestion:
Since it has method Submit, when your Screen Action reaches the End tool it will re-execute the Preparation and then re-render the screen, but it will not reset the values of any of the screen variables.
This will only work while you remain on the same screen (as it is using a Screen Local Variable. If you want a "Total" calculation based solely on database values, you will need to use an extra Aggregate, with a Sum aggregate function on the Valor attribute of your entity. Then you can easily display the result of your aggregate.
Hope this helps! If you cannot apply what you learnt on the online training, maybe classroom training with a Portuguese-speaking trainer would be better suited to get you started with OutSystems. Correctly understanding that one week course is fundamental to kickstart your OutSystems knowledge
Jorge Martins escreveu:
Quando você clica em um botão com o método de envio, os dados que a entrada do usuário é enviada ao servidor e estarão disponÃveis para você fazer o que quiser.
Minha sugestão:
Como possui o método Submit, quando a ação da tela chegar à ferramenta Final , ela executará novamente a preparação e renderizará novamente a tela, mas não redefinirá os valores de nenhuma das variáveis da tela.
Isso funcionará apenas enquanto você permanecer na mesma tela (pois está usando uma Variável local da tela. Se desejar um cálculo "Total" com base apenas em valores do banco de dados, será necessário usar um agregado extra, com uma função agregada Sum em o atributo Valor da sua entidade e, em seguida, você pode exibir facilmente o resultado do seu agregado.
Espero que isto ajude! Se você não pode aplicar o que aprendeu no treinamento on-line, talvez o treinamento em sala de aula com um treinador de lÃngua portuguesa seja mais adequado para você começar com o OutSystems. Entender corretamente que o curso de uma semana é fundamental para alavancar o seu conhecimento OutSystems
Teria algum modo mais simples? Porque eu só queria pegar esse valor e adicioná-lo sempre que um novo cliente é registrado, e esse valor é exibido
Paulo Junior wrote:
Jorge Martins wrote:
The part I quote in bold from my answer above is "the simple way" you ask for (and the other solution I described would not work for Mobile):
Hope this is clear enough for you (and again, part of training if I remember correctly)
maybe you can help us to understand a bit more about your use case.
Can you tell us more about your data model or the table you are using to save your data? The screenshot you just shared is too generic and doesn't say where the values are coming from and what do you need to sum.
Can you give more details about what are you trying to achieve?
Vera Tiago wrote:
In this form the data is being saved in the database, I would like when saving each customer, together with the VALUE, was added, and given the total result, always like this!
You should do a query to sum all values from client and use this sum in the screen.
But this is a basic programming concept and not a Outsystems question.
Bruno Schumacher escreveu:
Você deve fazer uma consulta para somar todos os valores do cliente e usar essa soma na tela.
Mas este é um conceito básico de programação e não uma questão de Outsystems.
sim exatamente isso, mas como posso fazer isso no OutSystems?
Conseguiu resolver ?