Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Josh_Rmg
Contributor II
Contributor II

.Net SDK - GetCurrentSelection obsolete

Hi,

I am getting the current selection of an app. Using the latest Qlik Sense .Net SDK.

var res = app.GetCurrentSelection().Selections.ToArray()[0].Selected;

However this method is obsolete/deprecated. I am confused on what method I should use instead as I can't find any documentation about it.

It says to use Layout reference: Layout.SelectionObject.Selections but I can't figure out how to do this.

 

Thanks for any help, it is much appreciated.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I believe it's the Selections property that is marked obsolete. The new path via Layout is:

app.GetCurrentSelection().Layout.SelectionObject.Selections

 

-Rob

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I believe it's the Selections property that is marked obsolete. The new path via Layout is:

app.GetCurrentSelection().Layout.SelectionObject.Selections

 

-Rob

Øystein_Kolsrud
Employee
Employee

Also, be aware that the "GetCurrentSelection" method creates a session object. So if you intend to call that method often, then it might be a good idea to simply save the returned object and reuse it instead of creating a new one each time.

https://help.qlik.com/en-US/sense-developer/August2021/Subsystems/NetSDKAPIref/Content/Qlik.Sense.Cl...

Josh_Rmg
Contributor II
Contributor II
Author

Ahh okay my bad I read the intellisense error wrong! No wonder I couldn't find documentation haha 😄

Working perfectly.

Thanks for the swift reply Rob.

- Josh