M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 27
Registered: ‎05-11-2018
Accepted Solution

Filtered list in mobile

Hi,

 

I am trying to filter a list by user in the Mobile app.

In my shell.xaml I have the following filter:

 

<Entity.Filters>
	<Filter Id="ASSIGNED_TO" Sql="ASSIGNED_TO = @{System.UserId}" IsDefault="True" />
</Entity.Filters>

How in my list.xaml can I implement the filter?

 

<List.ShellActions>
        
</List.ShellActions>
    <ListCell Name="STREET_NAME" Title="Street" />  
    <ListCell Name="ASSIGNED_TO" Title="User"/>	

 

Thank You

Ciaran

Highlighted
Technical Evangelist
Posts: 715
Registered: ‎11-12-2015

Re: Filtered list in mobile

Hi Ciaran,

 

You can use a Search against the list as a Filter here.

 

Using your 'ASSIGNED_TO' Filter example it would look something like:

<List.ShellActions>
   <SearchShellAction Filter="ASSIGNED_TO" />
</List.ShellActions>

HTH

Highlighted
Staff
Posts: 105
Registered: ‎10-25-2016

Re: Filtered list in mobile

Hi Ciaran,

 

you can also have a look at Lab 5b (https://community.hexagongeospatial.com/t5/M-App-Enterprise-Tutorials/How-to-setup-a-Mobile-App-Part...) how to apply a filter to a specific list.

 

If you specify IsDefault="True" to your entity filter, it will be applied at synchronization level. If you set it to IsDefault="False", you can use it as default filter on a list or e.g.: to filter items of a picker.

 

Regards

Christian

 

 

Highlighted
Contributor
Posts: 27
Registered: ‎05-11-2018

Re: Filtered list in mobile

Hi Christian,

 

That works perfect

 

Thank you

Ciaran

Highlighted
New Contributor
Posts: 2
Registered: 4 weeks ago

Re: Filtered list in mobile

I have the same issue 

I need to filter two lists from one entity but it takes one filter only on the two lists!!

it takes the one who is the value of IsDefault="True".

 

and if I put the value "True" in the two filters, it's sync and not view any records in the two lists. 

 

and if I put the value "False" in the two filters, it does not filter in the two lists. 

 

here are my Entity Filters

<Entity.Filters>
	<Filter Id="change_id" Sql="change_id Like @{change_id}" />
					
	<Filter Id="id1" Sql="sec ='مركز مغاغة' AND change_status=3"  IsDefault="False"/>
								
	<Filter Id="id2" Sql="sec ='مركز مغاغة' AND change_status=6" IsDefault="True" />
</Entity.Filters>

and here are my Navigations

<Navigation Id="PointNavigation">
				
                 <List Id="PointList" Title="قائمة المتغيرات المكانية لأول مرة" View="PointList" Entity="{x:Reference points_menia}">
								
				<List.Filters>

					<FilterRef Filter="{x:Reference id1}" Title="قائمة المتغيرات المكانية لأول مرة" />

			        </List.Filters>
					
				<Form Id="PointForm" Title="قائمة إدخال البيانات " View="PointForm" Entity="{x:Reference points_menia}" Target="PointList" />		
					
		</List>
</Navigation>
				
<Navigation Id="PointNavigationSecond">
				
                <List Id="PointList2" Title="قائمة المتغيرات المكانية لأعادة الرد" View="PointList" Entity="{x:Reference points_menia}">
					
			<List.Filters>

			  <FilterRef Filter="{x:Reference id2}" Title="قائمة المتغيرات المكانية لأعادة الرد"  />

			</List.Filters>	
							
			<Form Id="PointForm2" Title="قائمة إدخال البيانات " View="PointForm" Entity="{x:Reference points_menia}" Target="PointList2" />		
						 
		</List>
					
</Navigation>

 am I miss something??