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)

PNG image to tooltip View

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    What's type of new_feedback field?

    If it's optionset you should compare not with label but with value of optionset.

    Can you also post here screenshot of your .png webresource?

  • Alexadkin Profile Picture
    517 on at

    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

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    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
    517 on at

    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
    84,331 Most Valuable Professional on at

    Can you please provide full code of your new_Feedback webresource?

  • Alexadkin Profile Picture
    517 on at

    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
    84,331 Most Valuable Professional on at

    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
    517 on at

    hi thanks again, it still didnt work

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    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
    517 on at

    Thanks Andrew

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