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)

Adding Icons and to grid column for related entity

(0) ShareShare
ReportReport
Posted on by 1,549

I am well aware of the possibility add icons to a view column in CRM, like in this post.

Now would it be possible to make this work for a related entity column?

For example - In the Queues view, we display the Case Priority. We want to add icons that are based on the Case Priority (prioritycode). How could we make this work?

Sample code:

function displaypriority(rowData, userLCID) {
var str = JSON.parse(rowData);
var coldata = str.prioritycode_Value;
var imgName = "";
var tooltip = "";

I guess the coldata here is not working because the field is in the Case entity (instead of the Queue Item entity).

Any help is appreciated

*This post is locked for comments

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

    Hi,

    I think this is because the name of the prioritycode field will have  the alias name prepended. Check below screenshoot of how it renders.

    6761.prioritycode.png

    Hope this helps.

  • yleclerc Profile Picture
    1,549 on at

    Thanks very much Ravi. Very helpful!

    I found the related alias using the debugger like you did.

    I tried to use it in the code, like this:

    var col_data = str.a_cf79ac6ed0e243f8b4514bbf0554999c.prioritycode_Value;

    But it's not working. Do you have any idea what else I could try?

  • yleclerc Profile Picture
    1,549 on at

    Full code:

    function displaypriority3(rowData, userLCID) {

       var str = JSON.parse(rowData);

       var col_data = str.new_priorite_Value;

       var imgName = "";

       var tooltip = "{" + col_data +"}";

       switch (col_data) {

          case 1:

           imgName = "new_priority_p1.png";

            tooltip = "P1 - Critique";

            break;

          case 2:

           imgName = "new_priority_p2.png";

             tooltip = "P2 - Élevée";

             break;

          case 3:

           imgName = "new_priority_p3.png";

             tooltip = "P3 - Normale";

             break;

          case 4:

           imgName = "new_priority_p4.png";

             tooltip = "P4 - Basse";

             break;

          default:

           imgName = "new_priority_p3.png";

            tooltip = "P3 - Normale";

            break;

       }

       var resultarray = [imgName, tooltip];

       return resultarray;

    }

    By the way, when I refer on another field (a queue item field), the code works. As soon as I update de coldata variable, it doesn't work.

  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Not sure. We (as a developer) don't have access to the alias name and can't control what it would be so I think this is not yet handled by Microsoft.

    It would be better to get the confirmation from MS Support.

  • Ben T Profile Picture
    803 on at

    Yvan, I'm facing this same problem. Did you find a solution?

  • yleclerc Profile Picture
    1,549 on at

    Hi Ben,

    I tried a lot of things and I never was able to make it work.

    What I ended up doing is add a Priority field in Queue items. And sync this field with the priority from the case (via workflow). So when the priority is updated in the case, the workflow updates the priority in the Queue item. And I can display icons from the Queue item views.

  • PhuocLV Profile Picture
    347 on at

    a full solution can found d365iconsandtooltips.com/

  • Ben T Profile Picture
    803 on at

    Phuoc,

    It doesn't look like that solution fixes the issue we are talking about. Also, it's a paid solution FYI.

  • Ben T Profile Picture
    803 on at

    Yvan,

    Ok, thanks for the information. I was hoping to create a calculated queue item entity field. For 1 way syncing of fields I like using calculated fields. However, the calculated fields on the queue item entity are different, and it didn't seem I could do what we needed. I guess we will also go with workflows.

    A couple questions

    1) do you notice any decreased performance? To me it looks like the grid loads a little slower because of the images, though it's subtle.

    2) do you have links on understanding queue items. I don't understand this queue item entity. We send records to the queue and they have all the same fields and forms and everything as the normal records. So what is the point of a queue item field, beside being easy for adding icons? Or maybe so all queue items can have the same field without that field being created on all the original entities?

  • Ben T Profile Picture
    803 on at

    Yvan,

    Ok, thanks for the information. I was hoping to create a calculated queue item entity field. For 1 way syncing of fields I like using calculated fields. However, the calculated fields on the queue item entity are different, and it didn't seem I could do what we needed. I guess we will also go with workflows.

    A couple questions

    1) do you notice any decreased performance? To me it looks like the grid loads a little slower because of the images, though it's subtle.

    2) do you have links on understanding queue items. I don't understand this queue item entity. We send records to the queue and they have all the same fields and forms and everything as the normal records. So what is the point of a queue item field, beside being easy for adding icons? Or maybe so all queue items can have the same field without that field being created on all the original entities?

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