Form dont save

Hi,

Im new on Outsystems, I try to create a From with Dropdown dinamic, When I choose an option the next Dropdown give me a value automaticaly, but when I click on save Button the data dont save my choices. I need a help to put my choices on my database "Formulario".

I use Reactive Web app

put my oml attached.

Hi

When i saw your oml find that you did not added Foreign Key in you Main table.inplace of text you should keep it FK of respective table.

Correct mapping should be like below..

Hi,




Is the issue resolved? if not then please debug the application.




Debugging is the best tool to solve this kind of issue.




Thanks

viktor carvalho wrote:

Hi,

Im new on Outsystems, I try to create a From with Dropdown dinamic, When I choose an option the next Dropdown give me a value automaticaly, but when I click on save Button the data dont save my choices. I need a help to put my choices on my database "Formulario".

I use Reactive Web app

put my oml attached.

Did you pass all mandatory attributes to the form? what is the error in the Service Center?

You are not using any of this input parameter, isn't that is missing? you have this entities attributes as mandatory but you aren't assigning this on your logic


inst missing an assign here to use the input parameters?

So here the problem is that you aren't assigning the input parameter that are mandatory to the creation of the record and because of the constraint will fail to save the form. So to work assign the missing values


Hope I could help you

Best regards

Carlos Lessa

Carlos Lessa wrote:

viktor carvalho wrote:

Hi,

Im new on Outsystems, I try to create a From with Dropdown dinamic, When I choose an option the next Dropdown give me a value automaticaly, but when I click on save Button the data dont save my choices. I need a help to put my choices on my database "Formulario".

I use Reactive Web app

put my oml attached.

Did you pass all mandatory attributes to the form? what is the error in the Service Center?

You are not using any of this input parameter, isn't that is missing? you have this entities attributes as mandatory but you aren't assigning this on your logic


inst missing an assign here to use the input parameters?

So here the problem is that you aren't assigning the input parameter that are mandatory to the creation of the record and because of the constraint will fail to save the form. So to work assign the missing values


Hope I could help you

Best regards

Carlos Lessa

Hi Carlos, 

I use input parameters to make my dropdown dinamic, I have a Filter to do that in the aggregates, but in this case I think I need to assign my input parameters to the respectives Fields of form.

In the Dinamic dropdown I need to create a Variable to make a filter and make he dinamic, but in the button Save, the variables isnt included, and the another fields that dont have variable he save normally. 

.

ex: With Variable, dont save.


without Variable  Save normally.


viktor carvalho wrote:

Carlos Lessa wrote:

viktor carvalho wrote:

Hi,

Im new on Outsystems, I try to create a From with Dropdown dinamic, When I choose an option the next Dropdown give me a value automaticaly, but when I click on save Button the data dont save my choices. I need a help to put my choices on my database "Formulario".

I use Reactive Web app

put my oml attached.

Did you pass all mandatory attributes to the form? what is the error in the Service Center?

You are not using any of this input parameter, isn't that is missing? you have this entities attributes as mandatory but you aren't assigning this on your logic


inst missing an assign here to use the input parameters?

So here the problem is that you aren't assigning the input parameter that are mandatory to the creation of the record and because of the constraint will fail to save the form. So to work assign the missing values


Hope I could help you

Best regards

Carlos Lessa

Hi Carlos, 

I use input parameters to make my dropdown dinamic, I have a Filter to do that in the aggregates, but in this case I think I need to assign my input parameters to the respectives Fields of form.

In the Dinamic dropdown I need to create a Variable to make a filter and make he dinamic, but in the button Save, the variables isnt included, and the another fields that dont have variable he save normally. 

.

ex: With Variable, dont save.


without Variable Save normally.


With variables you need to assign back to the record source to save if not will not find and that attributes are mandatory in your table 


Carlos Lessa wrote:

viktor carvalho wrote:

Carlos Lessa wrote:

viktor carvalho wrote:

Hi,

Im new on Outsystems, I try to create a From with Dropdown dinamic, When I choose an option the next Dropdown give me a value automaticaly, but when I click on save Button the data dont save my choices. I need a help to put my choices on my database "Formulario".

I use Reactive Web app

put my oml attached.

Did you pass all mandatory attributes to the form? what is the error in the Service Center?

You are not using any of this input parameter, isn't that is missing? you have this entities attributes as mandatory but you aren't assigning this on your logic


inst missing an assign here to use the input parameters?

So here the problem is that you aren't assigning the input parameter that are mandatory to the creation of the record and because of the constraint will fail to save the form. So to work assign the missing values


Hope I could help you

Best regards

Carlos Lessa

Hi Carlos, 

I use input parameters to make my dropdown dinamic, I have a Filter to do that in the aggregates, but in this case I think I need to assign my input parameters to the respectives Fields of form.

In the Dinamic dropdown I need to create a Variable to make a filter and make he dinamic, but in the button Save, the variables isnt included, and the another fields that dont have variable he save normally. 

.

ex: With Variable, dont save.


without Variable Save normally.


With variables you need to assign back to the record source to save if not will not find and that attributes are mandatory in your table 


how can I assign the record? I try to Assign but I dont understant, I choose the Variable but I cant assign to DataBase attribute.


Salman Ansari wrote:

Hi

When i saw your oml find that you did not added Foreign Key in you Main table.inplace of text you should keep it FK of respective table.

Correct mapping should be like below..

this is My entity to create my form, I cant put my categoriaRiscoNivel2 FK, because this attribute Have data. If I do that I cannot use to insert data.



viktor carvalho wrote:

how can I assign the record? I try to Assign but I dont understant, I choose the Variable but I cant assign to DataBase attribute.


Viktor you must add an assign inside your action and do the mapping between your source entities and the input parameter

in the pic, I did the example with Ocorrencia, you must do the same with all input parameters that you didn't bind in the form

But If was me, II would remove those input parameters and do the assign before calling the action "FormularioCreateOrUpdate", like here in this empty circle before the action, this way you don't need all those inputs when you already have in the source

Hope I could help you

Best Regards

Carlos Lessa

Carlos Lessa wrote:

viktor carvalho wrote:

how can I assign the record? I try to Assign but I dont understant, I choose the Variable but I cant assign to DataBase attribute.


Viktor you must add an assign inside your action and do the mapping between your source entities and the input parameter

in the pic, I did the example with Ocorrencia, you must do the same with all input parameters that you didn't bind in the form

But If was me, II would remove those input parameters and do the assign before calling the action "FormularioCreateOrUpdate", like here in this empty circle before the action, this way you don't need all those inputs when you already have in the source

Hope I could help you

Best Regards

Carlos Lessa

Carlos, 

I undestand what you said, but I have another doubt. 

My input parameters local variables its a Identifiers. when I assign in the action they save a Identifiers. How can I save the choice that I make. Sorry, but Im new on Outsystems.


Solution

viktor carvalho wrote:

Carlos, 

I undestand what you said, but I have another doubt. 

My input parameters local variables its a Identifiers. when I assign in the action they save a Identifiers. How can I save the choice that I make. Sorry, but Im new on Outsystems.


They save an identifier cuz is the reference you need to the table where this record is, for example, if you save your with the id=1, I know that if I query the table where this record lives I will retrieve the data (Name, address, etc).

If you want to save the choices you did(label from the dropdown for example) you must change the table where you receive these values to text and assign the label instead of the identifier but in most of the cases this isn't good cuz if you change the label in the original table all records you save using your choices(Labe) will have the old name and will not be proper with the database, and if you are making queries using string, you will not find that string cuz it's already a different name in the database.


I advise you to follow the Bootcamp in OutSystems page as you said you are new in Outsystems, all these concepts are explained there

reactive: https://www.outsystems.com/learn/paths/18/becoming-a-reactive-web-developer/

traditional web:https://www.outsystems.com/learn/courses/114/developing-web-apps-outsystems-11/?LearningPathId=2

mobile:https://www.outsystems.com/learn/courses/115/developing-mobile-apps-outsystems-11/?LearningPathId=1


Best regards

Carlos Lessa


Solution

Carlos Lessa escreveu:

viktor carvalho escreveu:

Carlos, 

Entendo o que você disse, mas tenho outra dúvida. 

Meus parâmetros de entrada variáveis locais são Identificadores. quando atribuo a ação, eles salvam um identificador. Como posso salvar a escolha que faço. Desculpe, mas sou novo no Outsystems.


Eles salvam um identificador porque é a referência que você precisa para a tabela em que esse registro está, por exemplo, se você salvar seu com o id = 1, eu sei que, se eu consultar a tabela em que esse registro vive, recuperarei os dados (Nome , endereço etc.).

Se você deseja salvar as opções que você fez (rótulo da lista suspensa, por exemplo), você deve alterar a tabela em que recebe esses valores para texto e atribuir o rótulo em vez do identificador, mas na maioria dos casos isso não é bom porque você altera o rótulo na tabela original; todos os registros salvos usando suas opções (Labe) terão o nome antigo e não serão adequados ao banco de dados; se você estiver fazendo consultas usando uma string, não encontrará essa string, porque já um nome diferente no banco de dados.


Aconselho que você siga a página Bootcamp no OutSystems, como disse que é novo no Outsystems, todos esses conceitos são explicados lá

reativo: https://www.outsystems.com/learn/paths/18/becoming-a-reactive-web-developer/

web tradicional:https://www.outsystems.com/learn/courses/114/developing-web-apps-outsystems-11/?LearningPathId=2

Móvel:https://www.outsystems.com/learn/courses/115/developing-mobile-apps-outsystems-11/?LearningPathId=1


Cumprimentos

Carlos Lessa


thanks for the Help, I will see this lessons.