Need help with an XML Fetch query in CRM.

HI All
I'm doing a XML fetch query in CRM. I'm looking to get a list of users from two different Business Units. I have it all working except I would like to code it to specifically leave out two specific users, namely SYSTEM and INTEGRATOR.

Here is the code. I'm very much a beginner with XML and appreciated any help.
Tks.

<fetch mapping="logical" count="50">
  <entity name="systemuser">
    <attribute name="domainname" />
    <attribute name="firstname" />
    <attribute name="fullname" />
    <attribute name="internalemailaddress" />
    <filter type='or'>
      <condition attribute="businessunitid" operator="eq" value="********-****-****-****-************" />
      <condition attribute="businessunitid" operator="eq" value="********-****-****-****-************" />
    </filter>
    <order attribute='domainname' descending='false' />
    </entity>
</fetch>
abainesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aftab_KhateebCommented:
You need to add another filter with conditon or type 'and' in  the FetchXML. Please find attached code and let me know how u go with this
<fetch mapping="logical" count="50">
  <entity name="systemuser">
    <attribute name="domainname" />
    <attribute name="firstname" />
    <attribute name="fullname" />
    <attribute name="internalemailaddress" />
<filter type='and'>
			<condition attribute='fullname' operator='ne' value='INTEGRATION'/>
			<condition attribute='fullname' operator='ne' value='SYSTEM'/>
</filter>

    <filter type='or'>
      <condition attribute="businessunitid" operator="eq" value="********-****-****-****-************" />
      <condition attribute="businessunitid" operator="eq" value="********-****-****-****-************" />
    </filter>
    <order attribute='domainname' descending='false' />
    </entity>
</fetch>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
abainesAuthor Commented:
Thanks for that Aftab_Khateeb. That solution worked perfectly.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Enterprise Software

From novice to tech pro — start learning today.