Skip to content

Use of operator EqualUserId should be available for lookups #1123

@Roland80

Description

@Roland80

I need to create a number of system views that show records from a table (new_project) where the current user is the records' owner or where the current user is set in a lookup on the records in new_project or where the current user is set in a lookup in a record related to the records in new_project.... if that makes sense :)

To sort of illustrate what I'm doing:

<fetch version="1.0" mapping="logical" distinct="true">
  <entity name="new_project">
    <attribute name="new_projectid" />
    <attribute name="new_name" />
    <order attribute="new_name" descending="false" />
    <attribute name="new_projectnumber" />
    <attribute name="new_projectstatus" />
    <filter type="and">
      <condition attribute="statecode" operator="eq" value="0" />
      <filter type="or">
        <condition entityname="aa" attribute="new_userid" operator="eq-userid" />
        <condition attribute="ownerid" operator="eq-userid" />
        <condition attribute="new_managerid" operator="eq-userid" />
      </filter>
    </filter>
    <link-entity name="new_projectuser" alias="aa" link-type="inner" from="new_projectid" to="new_projectid" />
  </entity>
</fetch>

As soon as I have the query in the query builder and (accidentally) click on one of the conditions in the OR filter that's not for the ownerid, the lookup changes to a GUID and the operator becomes Equal, with no way of changing the operator back to EqualUserId. This is understandable as I can't expect the FetchXML Builder to know the lookup is to the systemusers table, but it's really quite annoying to have to make the change in the FetchXML code when it could be an option in the dropdown.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions