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 365 | Integration, Dataverse...
Answered

Show Icon in View

(0) ShareShare
ReportReport
Posted on by 270

I'm trying to show an icon in a view according to an option set, but if I throw an alert on col_data I get undefined and it does not work and defaults to the default value.

They should be case 1 which is Yes and Green, any advice is most appreciated as it's driving me nuts.

function displayIconTooltip(rowData, userLCID) {
    var str = JSON.parse(rowData);
    var col_data = str.new_aged_Value;
    var imgName = "";
    var tooltip = "{"   col_data   "}";

    switch (col_data) {
        case 1:
            imgName = "new_Green";
            tooltip = "Green";
            break;
        case 2:
            imgName = "new_Red";
            tooltip = "Red";
            break;
        default:
            imgName = "new_other";
            tooltip = "Unknown";
            break;
    }
    var resultarray = [imgName, tooltip];
    return resultarray;
}

pastedimage1598472183400v1.png

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi GRedhead,

    I have test your code, it run successfully.

    pastedimage1598498289829v1.png

    So you need to check following points:

    1.size of your upload pictures.

    Microsoft recommends an icon size of 16×16 pixels or larger. Larger file sizes will be scaled down.

    2.Make sure value of option set field is correct.

    a-1

    b-2

    c-3

     pastedimage1598498301401v2.png

    pastedimage1598498344689v4.png

    You can refer following link:

    https://d365goddess.com/d365-ce-adding-icons-to-views/

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    GRedhead Profile Picture
    270 on at

    Thanks, it was the name of the icon that was the issue in the end.

    I had entered the schema name and had given it a diffrent name without the prefix, once i updated the image name to also be new_Greena and new_Red it worked.

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 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans