Problem with List variables

Problem with List variables

  
Hello,

I have created two variables of List type. 
After this I created one combo box and assigned one List variable as a source of RecordList of Combobox.

Now my purpose is, whenver I select any value from Combobox that value must be added in another list and that value must be disappeared from Combobox.

For this purpose I have written logic on onchange event of combobox.

Consider my list variables are as DeviceList and DeviceList2.

Onchange event I am assigning DeviceList2 value to DeviceList so that DeviceList variable will become empty. After that I am running foreach loop to remove added value from the list. This foreach loop will create 'DeviceList' list and that list will be assigned to ComboBox again so that next time I won't see added value in the combobox.

This works fine when I add first value from combobox into another list.

Problem comes when I am adding another value into another list.

My second variable DeviceList2 gets assigned a list of current values from DeviceList. Here I want to create empty DeviceList but it's not working.



Here on assign widget, I am assigning DeviceList2 to DeviceList. As per logic DeviceList2 will be empty but when this loop runs DeviceList2 gets values. Why this is happening because from nowhere I am assigning values to DeviceList2?

Please advice.

Thanks and Regards,
Suraj Borade
Hi Sooraj,

i have atteched the screen shot what we did in our project too,
for assigning the element from 1 list to another and remove the elements from previous one

Regards,
MJ
Hi Manish,

Thanks for the screen print. Can you please provide this with oml?

Thanks and Regards,
Suraj Borade
Hi Sooraj,

I can't this is client project, we are not suppose to share the code.
If you need, i can share the entire code logic.

Regards,
MJ
Hi Manish,

Thanks.
I am not able to see variables and conditions inside that screen print. If you have time, you can develop that logic in personal environment and share the oml else please explain the logic.

Looking forward to hear from you.

Thanks and Regards,
Suraj Borade
Solution
Hi Buddy,

I solved my problem. I used ListClear() action from system and deleted that second variable DeviceList2 which I used to clear first list.



But question is still there from where that second list variable was getting values? I am forwarding this to CSP.

Thanks and Regards,
Suraj Borade
Solution
Hi Sooraj,

I have attached the sample oml for you.

Thanks,
MJ
Hi Suraj,
Plesae see the attached OML , publsih it to your enviorment and you first need to craete some record using the Key Vals menu and than try the combo Demo menu .
I tested it and is working fine.

Regards
-PJ-
Just refreshed the page and seems like you solved the problem ..anyways check this also ..i tried very simple approach.

Regards
-PJ-
Thanks Manish and Pramod. Learnt something new.