Solved

K2 SmartForm - Editable List View - Add multiple record/ rows

  • 23 October 2018
  • 4 replies
  • 48 views

Badge +4

Hi All,

I am new in K2.

I have developed one K2 Smartform which will allow to add multiple records/ rows in to a table. for this i did followings:

1. Created one advance smartobject for the table, where data will be stored.

2. Designed an editable list view with a button (save). On click the button data will be saved to the table

 

It will be nice if you let me know what rule i should define against the button, along with others seeting (if any is required) to save records.

 

Thanks with Regards,

JD

icon

Best answer by khanh1 23 October 2018, 23:43

View original

4 replies

Badge +11

Under rule conditions there is a for-each operator along with list view status.  So you could have logic that looks like this:

when the save button is clicked

for each item that was added to the list view

  execute the view Create method (configure)

 

if you allow editing the list after it was saved you would add some more conditions:

for each item that was changed in the list view

   execute the list Save method (configure)

 

for each item that was deleted from the list view

  execute the list Delete method (configure)

 

Make sure in your create/save/delete methods you map to the SmartObject properties which will contain the value of the current row.

 

If this helps, please click the Kudos button.


David

Userlevel 6
Badge +16

Hi JD1,


 


You can also find more information on For each loop from the link below.


https://help.k2.com/onlinehelp/k2five/userguide/5.1/default.htm#How-Tos/ForEachLoopingConditions/HowToUseForEachLoopingConditions.htm


 

Badge +4

Hi David,

 

Thanks for your reply. it's help me to resolve my issue.

 

Badge +4

Hi Khanh,

 

Thanks for your reply. it's help me to resolve my issue.

Reply