Inserting multiple record into same entity in a form, with 'Save' button

Hi...I'm new here.

I'm trying to insert multiple records(name) into same entity(Member) in a form.

In my form, I have multiple text field for user input and tied to the variable.

GetMemberById.List.Current.Member.name

Whenever user key in the data, all the field will also fill up the same data.

So, anyway to create 'multiple' text field and insert different record into the entity, using save button?

For mobile app...

Thanks in advanced.

I'm not sure  I am understanding your question correctly, but if so - just programmatically create the new records and call the save multiple times.

I have managed to create each text field with a variable and insert into the same entity. It works.

But I have the following message becauseI have multiple CreateandUpdate Server action for each record.
"The 'SearchSecurityOnClick' Client Action calls several Server Actions. To avoid performance issues, group them all in a single Server Action and call it instead." (See below).

Is there a better way to do it?





Hi,


Add local variable of data type entity as a  List.

and store all values in list and then use foreach block and call server action to insert data in entity.


Thanks.

Check my comment/screenshot in this post, hope it could helps you!

https://www.outsystems.com/forums/discussion/45549/movie-details-are-inserted-in-db-as-empty/

Thanks and Best Regards,

Nuno Pereira

JitendraYadav wrote:

Hi,


Add local variable of data type entity as a  List.

and store all values in list and then use foreach block and call server action to insert data in entity.


Thanks.

Hi, thanks for the advice. I have mange to add local variable of data type entity as a List. (Done debugging and successful)

Try using For Each loop as follows... but not working. Below i s what I did. Not sure I did it correctly.

SecuritySum is my variable list....

Are you able to show me an example using the for each block? Thanks!



JitendraYadav wrote:

Hi,


Add local variable of data type entity as a  List.

and store all values in list and then use foreach block and call server action to insert data in entity.


Thanks.

Can advise how to store values into the list? By doing the assign (Shown below), does it already store automatically into Id1 of the list? I need to store a few sets of theses into the list.


Joseph Lim wrote:

JitendraYadav wrote:

Hi,


Add local variable of data type entity as a  List.

and store all values in list and then use foreach block and call server action to insert data in entity.


Thanks.

Can advise how to store values into the list? By doing the assign (Shown below), does it already store automatically into Id1 of the list? I need to store a few sets of theses into the list.


Yes, if id 1 still not exists in your table, it will create a record with this id. If exists, he update it.

you should use "IntegerToIdentifier(1)" instead only "1", because you are assigning a value of type integer to an atttribute of LongInteger type / Identifier. It can cause you some errors in runtime.

Thanks and Best Regards,

Nuno Pereira


Nuno Gonçalo Pereira wrote:

Joseph Lim wrote:

JitendraYadav wrote:

Hi,


Add local variable of data type entity as a  List.

and store all values in list and then use foreach block and call server action to insert data in entity.


Thanks.

Can advise how to store values into the list? By doing the assign (Shown below), does it already store automatically into Id1 of the list? I need to store a few sets of theses into the list.


Yes, if id 1 still not exists in your table, it will create a record with this id. If exists, he update it.

you should use "IntegerToIdentifier(1)" instead only "1", because you are assigning a value of type integer to an atttribute of LongInteger type / Identifier. It can cause you some errors in runtime.

Thanks and Best Regards,

Nuno Pereira


Thanks! Am I doing it right? 


Joseph Lim wrote:

Nuno Gonçalo Pereira wrote:

Joseph Lim wrote:

JitendraYadav wrote:

Hi,


Add local variable of data type entity as a  List.

and store all values in list and then use foreach block and call server action to insert data in entity.


Thanks.

Can advise how to store values into the list? By doing the assign (Shown below), does it already store automatically into Id1 of the list? I need to store a few sets of theses into the list.


Yes, if id 1 still not exists in your table, it will create a record with this id. If exists, he update it.

you should use "IntegerToIdentifier(1)" instead only "1", because you are assigning a value of type integer to an atttribute of LongInteger type / Identifier. It can cause you some errors in runtime.

Thanks and Best Regards,

Nuno Pereira


Thanks! Am I doing it right? 


Hi,

Can you attach the oml?

Also check the warning which is dosplayed for the createorupdate action



Priya Khade wrote:

Joseph Lim wrote:

Nuno Gonçalo Pereira wrote:

Joseph Lim wrote:

JitendraYadav wrote:

Hi,


Add local variable of data type entity as a  List.

and store all values in list and then use foreach block and call server action to insert data in entity.


Thanks.

Can advise how to store values into the list? By doing the assign (Shown below), does it already store automatically into Id1 of the list? I need to store a few sets of theses into the list.


Yes, if id 1 still not exists in your table, it will create a record with this id. If exists, he update it.

you should use "IntegerToIdentifier(1)" instead only "1", because you are assigning a value of type integer to an atttribute of LongInteger type / Identifier. It can cause you some errors in runtime.

Thanks and Best Regards,

Nuno Pereira


Thanks! Am I doing it right? 


Hi,

Can you attach the oml?

Also check the warning which is dosplayed for the createorupdate action



Hi! Thanks in advanced.

What I'm trying to do is to declared data into variable list. Then use for each to loop 2 x record into the SecuritySum Entity. 2 x data should have recorded into the variable list. But it don't write into the entity.

Attached is my file.


Joseph Lim wrote:

Priya Khade wrote:

Joseph Lim wrote:

Nuno Gonçalo Pereira wrote:

Joseph Lim wrote:

JitendraYadav wrote:

Hi,


Add local variable of data type entity as a  List.

and store all values in list and then use foreach block and call server action to insert data in entity.


Thanks.

Can advise how to store values into the list? By doing the assign (Shown below), does it already store automatically into Id1 of the list? I need to store a few sets of theses into the list.


Yes, if id 1 still not exists in your table, it will create a record with this id. If exists, he update it.

you should use "IntegerToIdentifier(1)" instead only "1", because you are assigning a value of type integer to an atttribute of LongInteger type / Identifier. It can cause you some errors in runtime.

Thanks and Best Regards,

Nuno Pereira


Thanks! Am I doing it right? 


Hi,

Can you attach the oml?

Also check the warning which is dosplayed for the createorupdate action



Hi! Thanks in advanced.

What I'm trying to do is to declared data into variable list. Then use for each to loop 2 x record into the SecuritySum Entity. 2 x data should have recorded into the variable list. But it don't write into the entity.

Attached is my file.


Thank you all. Had resolved!