Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to use aliases. #1039

Closed
trotsallt opened this issue Apr 10, 2024 · 4 comments
Closed

Be able to use aliases. #1039

trotsallt opened this issue Apr 10, 2024 · 4 comments

Comments

@trotsallt
Copy link

Hi, thx for a great tool. A question, if I use aliases on fields they don't seem to show up at all in the result.
Am I doing something wrong or is this something that could be fixed?
image
image

I can run this in the fetchxml tester tool though and get the result with fields named.
image

@rappen
Copy link
Owner

rappen commented Apr 11, 2024

Hi

First, normally we don't use alias unless you do aggregated queries. But I know, according to the docs, it works.
So it works, and it works for me at least.

Second screenshot: I have the same issues, in the "raw" result, it doesn't show up. If I remove alias from attributes, it shows up.
At this point I'm not sure if the issue is in FXB or in the SDK. But I see that the SDK has deprecated that request.

Third screenshot: FetchXml Tester always just shows the data returned. In my grid view it's trying to show it with correct column name etc. which my be something I should try to show alias name instead.

My query when I'm trying:

<fetch>
  <entity name='contact'>
    <attribute name='fullname' alias='ThePerson' />
    <attribute name='ownerid' alias='TheOwner' />
    <link-entity name='systemuser' from='systemuserid' to='ownerid' alias='USER'>
      <attribute name='lastname' alias='TheOwnerLastname' />
    </link-entity>
  </entity>
</fetch>

Result in a "not friendly" view:
image

Result in a "friendly" view:
image

Raw result:

<resultset morerecords='0' paging-cookie='&lt;cookie page="1"&gt;&lt;contactid last="{41388504-F44A-EC11-8C62-6045BD8F5259}" first="{5E7F1131-2DAD-EC11-9840-000D3A2BC35A}" /&gt;&lt;/cookie&gt;'>
  <result>
    <contactid>{5E7F1131-2DAD-EC11-9840-000D3A2BC35A}</contactid>
  </result>
  <result>
    <contactid>{DBD00E67-6E63-EC11-8F8F-000D3A2D112C}</contactid>
  </result>
  <result>
    <contactid>{B8706CDA-EEE4-EC11-BB3C-000D3A3A8AD0}</contactid>
  </result>
  <result>
    <contactid>{2355B467-533E-EC11-8C63-000D3A4A08D0}</contactid>
  </result>
  ...

Querying without aliases:

<resultset morerecords='0' paging-cookie='&lt;cookie page="1"&gt;&lt;contactid last="{41388504-F44A-EC11-8C62-6045BD8F5259}" first="{5E7F1131-2DAD-EC11-9840-000D3A2BC35A}" /&gt;&lt;/cookie&gt;'>
  <result>
    <fullname>Anders Rapp</fullname>
    <ownerid dsc='' type='8' yomi='Jonas Rapp' name='Jonas Rapp'>{B5863A5C-5934-EC11-8C65-000D3A217588}</ownerid>
    <contactid>{5E7F1131-2DAD-EC11-9840-000D3A2BC35A}</contactid>
    <USER.lastname>Rapp</USER.lastname>
  </result>
  <result>
    <fullname>Frederick W. Sturckow</fullname>
    <ownerid dsc='' type='8' yomi='Jonas Rapp' name='Jonas Rapp'>{B5863A5C-5934-EC11-8C65-000D3A217588}</ownerid>
    <contactid>{DBD00E67-6E63-EC11-8F8F-000D3A2D112C}</contactid>
    <USER.lastname>Rapp</USER.lastname>
  </result>
  ...

@trotsallt
Copy link
Author

trotsallt commented Apr 12, 2024 via email

@rappen
Copy link
Owner

rappen commented Apr 13, 2024

I was thinking about any Alias shall override DisplayName in "Friendly" view, and make sure LogicalName are shown in "raw" view.
Do you agree with my idea?

I'm working now for solving a bunch of new features, and fixing some bugs. We'll see if I solve this one for this release.

@rappen
Copy link
Owner

rappen commented Apr 17, 2024

Sorry, I misunderstood your request, I was thinking about View Result and not Friendly.

I have investigating more regarding ExecuteFetchRequest and it just don't return attributes that have an alias. Period.
We shouldn't use it.

I have improved the View Result though, with better handling of Alias.

I believe this issue is now "solved", as far as possible.
Please reopen it if needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants