04-16-2019 12:54 AM
Hi,
Is it possible to use a session variable in Shell.xaml?
I have the following list which displays areas and sets a session key (AREA_NAME) based on the users selection:
<List.SelectionScript> var AREA_NAME = = ''; Context.setSessionKey(AREA_NAME, Context.getValue('Waste_Admin_Area')); </List.SelectionScript> <ListCell Name="Waste_Admin_Area" Title="AREA TO SURVEY" />
In the Shell.xaml I would like to use this key as a filter within my navigation like this:
<Navigation Id="AREA_STREET_LIST"> <List Id="WMS_SURVEY" Title="Survey" View="AreaList" Entity="{x:Reference AdminArea}"> <List Id="SurveyList_CITY_CENTRE" Title="Streets To Survey" View="SurveyList" Entity="{x:Reference WMS_STREET_SURVEY}"> <Form Id="SurveyFormCityCentre" Title="Street Survey" View="SurveyForm" Entity="{x:Reference WMS_STREET_SURVEY}" Target="SurveyList" /> <List.Filters> <FilterRef Filter="{x:Reference AREA_NAME}" Title="AREA" IsDefault="False"/> </List.Filters> </List> </List> </Navigation>
Is this possible?
The filters in the Shell.xaml will look something like this:
<Filter Id="AREA_CITY_CENTER" Sql="AREA = 'CITY CENTER'" IsDefault="False"/> <Filter Id="AREA_NORTH_WEST" Sql="AREA = 'NORTH WEST'" IsDefault="False"/>
Thank you.
Ciaran
Solved! Go to Solution.
04-16-2019 02:03 AM
Hi Ciaran,
If you set the session value in the selection script like that:
Context.setSessionKey('AREA_NAME', Context.getValue('Waste_Admin_Area'));
You should be able to use it in a filter in the following way:
<Filter Id="AREA_FILTER" Sql="AREA = @{AREA_NAME}" IsDefault="False"/>
Regards
Christian
04-25-2019 05:43 AM
Hi Christian,
This worked.
Thanks
Ciaran