Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

PNG image to tooltip View

Posted on by 517

Hi im trying to add a tooltip image to a view column, i have uploaded the web resource .png and tweaked some code of the web as below

is the code alright? i check all the basics such as names and the the view is not an editable grid

function DisplayCustomIcons(row, lcid) {

var tooltip = " ";
var rowStr = JSON.parse(row);
var imageName = "";
var column_data =
rowStr.new_feedback;

if (column_data === "Likely To Renew") {
imageName = "new_FeedbackLikely";
tooltip = "Likely"
}

var result =[imagename, tooltip];
return result;

}

am i missing something? thanks

*This post is locked for comments

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: PNG image to tooltip View

    One thing to add here.

    Can you verify the name of the column is correct? It seems like the name of the WebResource and the name of the column your specified are the same (except for capital F).

    Can you just confirm that?

    If that's the case, as Andrew mentioned, press F12 when the view loads, and find your function in the list of scripts that can be debugged. Put a breakpoint and see where the problem is.

  • Alexadkin Profile Picture
    Alexadkin 517 on at
    RE: PNG image to tooltip View

    Thanks Andrew

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: PNG image to tooltip View

    Then I'm afraid you will have to learn how to troubleshoot JS code using your browser - blogs.msdn.microsoft.com/.../debugging-custom-javascript-code-in-crm-using-browser-developer-tools

    Good luck.

  • Alexadkin Profile Picture
    Alexadkin 517 on at
    RE: PNG image to tooltip View

    hi thanks again, it still didnt work

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: PNG image to tooltip View

    Try to replace line

    var column_data = rowStr.new_feedback;

    with line

    var column_data = rowStr.new_feedback_Value;

    Also you can check following article as a brilliant example - neilparkhurst.com/.../dynamics-365-icons-in-views

  • Alexadkin Profile Picture
    Alexadkin 517 on at
    RE: PNG image to tooltip View

    Hi Andrew, 

    The full code is mentioned above, the first post and then changed only to the code you provided, that is the complete code i have used. 

    Regards

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: PNG image to tooltip View

    Can you please provide full code of your new_Feedback webresource?

  • Alexadkin Profile Picture
    Alexadkin 517 on at
    RE: PNG image to tooltip View

    Hi Andrew,

    I wanted this to work i'm afraid it still isn't giving me an .png image in the column, just the text value

    image of column properties if that helps, does your script need to call a function?  or can i remove the function name from the column properties?

    Thanks

    Tool.PNG

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: PNG image to tooltip View

    Try to use following code:

    var tooltip = "";

    var imageName = "";

    var rowStr = JSON.parse(row);

    var column_data = rowStr.new_feedback;

    if (column_data == 279640000) {

    imageName = "new_FeedbackLikely";

    tooltip = "Likely"

    }

    var result =[imagename, tooltip];

    return result;

  • Alexadkin Profile Picture
    Alexadkin 517 on at
    RE: PNG image to tooltip View

    Hi Andrii, 

    the feedback field is a global option set, 

    as requested the web resource screenshot below

    WR.PNG

    i changed the code to the value JS below (still didnt work) its a calculated option set will that matter?

    function DisplayCustomIcons(row, lcid) {

    var tooltip = " ";
    var rowStr = JSON.parse(row);
    var imageName = "";
    var column_data =
    rowStr.new_feedback;

    if (column_data === "279,640,000") {
    imageName = "new_FeedbackLikely";
    tooltip = "Likely"
    }

    var result =[imagename, tooltip];
    return result;

    Thanks

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans