web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to filter by postal code range?

(0) ShareShare
ReportReport
Posted on by 1,145

Hello,

I have to do an ExecuteMultiple, using a filter by the standard field "address1_postalcode".

The condition of the filter is that the postal code shoud be in a range.

I used this two filters, but the result does'nt take into account the condition:

 filter.Conditions.Add(new ConditionExpression("address1_postalcode", ConditionOperator.LessThan, postalcodeMax));
 filter.Conditions.Add(new ConditionExpression("address1_postalcode", ConditionOperator.GreaterThan, postalcodeMin));


PostalcodeMin and postalcodeMax are integers, and I know that postalCode field is string.

Do you have any idea?

Thanks

*This post is locked for comments

I have the same question (0)
  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi saadzag,

    address1_postalcode field is of string type so number operators won't work here. We usually create custom postal code field of type whole number and use that for this kind of stuff.

    The option I can think for you is also on the same lines i.e. create a new custom field of type whole number, update the values and use this field instead.

    This would also help you in advance find queries as well.

    Thanks,

    Ravi

  • RaviKashyap Profile Picture
    55,410 Moderator on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans