Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

how can i create health flag by html

(0) ShareShare
ReportReport
Posted on by 134

i want to create health flag  , i create one field on that if i insert 0-5 show different colour flag  ,5-10 different colour flag like that how it is possible ,

i used this code 

<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() {
var value1 = window.parent.Xrm.Page.getAttribute("new_health").getValue();

if (value1 < 5) {
<p><font color="yellow" size="20"> &#9873;</font></p>


else if (value1 == 5 || value1 < 10) {
<p><font color="blue" size="20"> &#9873;</font></p>

else if (value1 == 10 || value1 < 15) {
<p><font color="purple" size="20"> &#9873;</font></p>

else if (value1 == 15 || value1 <= 20) {
<p><font color="red" size="20"> &#9873;</font></p>
}

else {
<p><font color="green" size="20"> &#9873;</font></p>
}
}
</script>

</body>
</html>

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: how can i create health flag by html

    The tag line you mentioned Visio Integration, what is the relation of this html with dynamics 365?

    However if you are showing this  html in Dynamics 365 forms , I would suggest use optionset with color instead of html

    Have a look below article -

    debajmecrm.com/.../dynamics-crm-optionset-color-codes

  • ThomasN Profile Picture
    3,190 on at
    RE: how can i create health flag by html

    Hi himy10, thanks for reaching out.

    What are you using g HTML for this? Can you provide some details to the environment? Portal or D365? Online or on-premise? What form?

    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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Dynamics 365 general forum

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans