Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Custom Icon in List View with Yes/No

Posted on by 215

I am attempting to have an image show up when a record is has a yes/no field as Yes(true).

I have implemented this before on an option set and it works perfect. But I have the Contact table and I added a Yes/No "VIP" column and I would like to have a gold star show up when it is Yes(true)

IDEALLY, I would love to have this image in the Full Name column next to the name based off of the VIP status, but I am unsure if that is possible.

//contact vip status
function contactVIP_star(rowData, userLCID) {
    var str = JSON.parse(rowData);
    var coldata = str.cyb_vip_Value;
    var imgName = "";
    var tooltip = "";
    switch (coldata) {
        case 1:
            imgName = "cyb_GoldStar";
            tooltip = str.cyb_vip;
            break;
        default: //default
            imgName = "cyb_red";
            tooltip = "X";
            break;
    }
    var resultarray = [imgName, tooltip];
    return resultarray;
}

Any help is appreciated, also, if any additional code/information is needed please let me know.

  • Bahalzamon Profile Picture
    Bahalzamon 215 on at
    RE: Custom Icon in List View with Yes/No

    Figured it out

    Adjusted the coldata to pull the actual data vs the value and the Case was a "Yes" and "No" not the values of 0 and 1 or true/false.

    //contact vip status
    function contactVIP_star(rowData, userLCID) {
        var str = JSON.parse(rowData);
        var coldata = str.cyb_vip;
        var imgName = "";
        var tooltip = "";
        switch (coldata) {
            case "Yes":
                imgName = "cyb_GoldStar";
                tooltip = str.cyb_vip;
                break;
            default: //default
                imgName = "";
                tooltip = "";
                break;
        }
        var resultarray = [imgName, tooltip];
        return resultarray;
    }

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

Product updates

Dynamics 365 release plans