Solved

Transfer data from one list to another list view

  • 17 April 2018
  • 2 replies
  • 2 views

Hello,

 

I am seeking help on following. Let me explain you the scenario.

 

I have created Smartbox SMO which contains details about Leave Year, Alloted leaves, Balance leaves and Availed leaves. Based on this SMO I created 02 Views as follows.

 

1. Alloted Leaves List View: This view contains details about Leave Year, Number of leaves and Total leaves etc.

2. Availed Leaves List View: This view conatins details about Balance Leaves and Availed leaves.

 

Now when New / Edit form gets loaded - User will select Alloted List View rows and based on this selection I want to display Availed and Balance leaves in another list view. So please can someone help me on this?

 

 

Thanks

Sachin

 

icon

Best answer by Themba 18 April 2018, 13:02

View original

2 replies

Userlevel 2

Good day Sachin,


 


Please below documentation that will guide on how to transfare data.


 https://help.k2.com/onlinehelp/K2smartforms/UserGuide/4.7/default.htm#How_Tos/Display_Related_Data_Using_One_SmartObject/DisplayRelatedDataUsing1SMO.htm


 


Hopefully the document will give you a bit of insight.


 


Kind regards


 

Badge +13

Good Day SachinSant


 


By the looks of your explained scenario it seem both view 1 and 2 are calling the the same smartobject (SMO 1), this smartobject contain data for the columns Leave Year, Allotted Leave, Leave Balance and Availed Leave. View 1 displays the Leave Year, Allotted Leave, Total Leave, etc. View 2 diaplays the Leave Balance and Availed Leave.


 


Now the goal you have is to display Availed Leave and Balance Leave when a record in view 1 is selected, so since view 2 contains both those columns i believe it would be safe to say the your requirement is to display view 2 when a record is selected in view 1, to achieve this goal please see the below steps (keeping in mind based on your description both view 1 and 2 is contained on a form:


 


Steps:


1) On the Form you would need to ensure that both view 1 and 2 is present on its design canvas.


2) Set view 2's visiblity to "invisible" from the From level.


3) You will need to add a data label on the Form.


4) Now add a rule on the Form that would transfer the ID from view 1 to the data label on view 1's record click event.


5) From the Form you would need a rule that needs to check if the data label changes, this rule would need a condition that need to check if the data label is empty. If it is empty you do not need to do anything, but if it is not empty then you need to set view 2's visibility to "visible" and execute its Getlist method while passing in the data label as the input mapping for the Getlist method.


 


Result:


This in essance will on form load display only list view 1, when a record on list view 1 is clicked list view 2 will be turned to visible and load all the records displaying Availed Leave and Leave Balance for the item connected to the provided ID (based on the record selected from list view 1).


 


Regards


Raymond


 


 

Reply