Started: 12/2/2021 7:20 AM
Picture Placeholder: Jim Hidson.
Jim Hidson.
How to add a child record in another linked list when a user clicks on a button on the main form

​If you want to just save an item/record in another list without the need to retrieve it back, you can simply create an action rule on a button and change the event to onClick.

Leave the condition blank.

In the action script, use the newListItem() function to save data in another list. Please refer to the function description and the  Use Cases Guide for more information on how to use the function.

If you want to retrieve this record in the form once opened again, then you need to query the data from that list when the form load. Create an action form rule, event onLoad, and use the function getListItemData() to do get the function and populate data on the forms control again.

 

But if you want to save and retrieve multiple records, then you need to have master-child/master-details functionality, which represents the relation of (one To many) in the database definition.

So the master list will have the main form information and the details list will be have the different records related to the main form. The detailed list will be linked to the master child list with a master id (like primary key in DB).

 

The best approach to do this is using the Repeater or DataTable control, you can specify the master id column in the child list when you configure the repeater.

 

Have a look at these videos which will help you build your case and to start thinking in the right direction:

 

https://www.youtube.com/watch?v=Hb2uJyKg7sE&t=52s

 

https://www.youtube.com/watch?v=dRybbrFPmOM&t=3s

 

https://www.youtube.com/watch?v=c9tESFL-LQo&t=67s

 

https://www.youtube.com/watch?v=gS48oeg09AM&t=6s

 

https://www.youtube.com/watch?v=e4hAZ7NeVtw&t=34s​

 

Picture Placeholder: Jim Hidson.
  • Jim Hidson.
/_layouts/15/images/person.gif" alt="Picture Placeholder: Jim Hidson." />
Jim Hidson.

​If you want to just save an item/record in another list without the need to retrieve it back, you can simply create an action rule on a button and change the event to onClick.

Leave the condition blank.

In the action script, use the newListItem() function to save data in another list. Please refer to the function description and the  Use Cases Guide for more information on how to use the function.

If you want to retrieve this record in the form once opened again, then you need to query the data from that list when the form load. Create an action form rule, event onLoad, and use the function getListItemData() to do get the function and populate data on the forms control again.

 

But if you want to save and retrieve multiple records, then you need to have master-child/master-details functionality, which represents the relation of (one To many) in the database definition.

So the master list will have the main form information and the details list will be have the different records related to the main form. The detailed list will be linked to the master child list with a master id (like primary key in DB).

 

The best approach to do this is using the Repeater or DataTable control, you can specify the master id column in the child list when you configure the repeater.

 

Have a look at these videos which will help you build your case and to start thinking in the right direction:

 

https://www.youtube.com/watch?v=Hb2uJyKg7sE&t=52s

 

https://www.youtube.com/watch?v=dRybbrFPmOM&t=3s

 

https://www.youtube.com/watch?v=c9tESFL-LQo&t=67s

 

https://www.youtube.com/watch?v=gS48oeg09AM&t=6s

 

https://www.youtube.com/watch?v=e4hAZ7NeVtw&t=34s​

 

012/2/2021 7:20 AM12/2/2021 7:20 AMNoSPARK Forms
0
12/2/2021 4:19 AM
There are no items to show in this view of the "Discussions List" discussion board.