Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

D365 Portal - Adding additional columns to lookup.

Posted on by Microsoft Employee

Does anyone have any experience with EntityLists and adding additional, calculated columns?

For example:

EntityA  has an EntityForm for Create/Edit. It has a field that is a lookup field (parent) to EntityB. When the lookup appears, I want to create a sortable, additional, column that is the sum of EntityA.NumberField and EntityB.NumberField.

I've been researching entitylists and liquid templates.  It looks like it might be possible, with exception to the sorting:

    <a href="{{ request.path_and_query | add_query:'order', c.sort_descending }}">
                    {{ c.name }} <i class="fa fa-sort-asc"></i>
{{ request.path_and_query | add_query:'order', c.sort_descending }} looks easy enough to replicate. Or am I missing something?

Can anyone provide any insight?

Thank you!

*This post is locked for comments

  • Suggested answer
    oliver.rodrigues Profile Picture
    oliver.rodrigues 4,052 on at
    RE: D365 Portal - Adding additional columns to lookup.

    first I would change the thread title, you are not talking about lookups here, it is entity list

    I agree with Ravi, I think calculated fields are the best / easier option, if you can't make the calculation through the calc fields, do it within a plugin or something, you will be using all OOB components in the portal, no problems for sorting etc

    another option would be adding this calculated field through JavaScript, I just don't think you would be able to manage the sorting

    but if you have a very big list here, and your calculation is a bit complex, it might slow down the rendering of you list, again another reason for you to go to the calculated field in CRM

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: D365 Portal - Adding additional columns to lookup.

    Okay. In that case I am not sure if we can use entity list/ liquid templates to display the additional calculated column dynamically. I am thinking this because even with liquid templats, you will render the entity list which will be formed using the system view. And you cannot add columns dynamically to system views.

    You may try researching on fetchxml & liquid and see if it is possible to return the column dynamically.

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: D365 Portal - Adding additional columns to lookup.

    Hi Ravi.

    The calculated columns wouldn't be a practical option.  Entity A and B represent two locations, and the calculated field represents the distance between the two.

    There would be no reason to store these values in the long run outside the duration of Entity B being called.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: D365 Portal - Adding additional columns to lookup.

    Hi,

    Did you try/consider creating calculated column within the Entity A in crm itself and then exposing that column in the view?

    Hope this helps.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans