We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

FindAppointment - Remove Default Restriction

Hi,

I'm wanting to ass a restriction to FindAppointment to filter on Appointment Type 1 and 6.

I have added the following:

new ArchiveRestrictionInfo()
{
   Name = "rawType",
   Operator = "in",
   Values = new string[] {"1", "6"},
   IsActive = true
}

However, when I run a SQL Trace, I can see there is a default restriction on this field already, and what I end up with is:

Where (T0."type" IN(1, 6)) AND (T0."type" IN(2, 1))

Resulting in me only getting Type=1 records.

I have tried adding: InterOperator = SuperOffice.Data.InterRestrictionOperator.Or to the restriction in the hope I would get 

Where (T0."type" IN(1, 6)) OR (T0."type" IN(2, 1)) but this resulted in an Exception of 'WCF Method Failed on Server'.

Is there a method to remove this default restriction, and if not, how would I achieve this another way?

Cheers

Rich

 

RE: FindAppointment - Remove Default Restriction

Hi Rich,

I do not believe "in" is an officially supported operator. ListAny types generally work with ints as well... Try "oneOf". 

new ArchiveRestrictionInfo() { Name = "rawType", Operator = "oneOf", Values = new[]{"1", "6"}, IsActive = true};

 

Hope this helps!

Av: Tony Yates 25. okt 2019