Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

Portal Entity List Show/Hide Custom Button Using Java Script on column value

Posted on by 15

I am adding a custom button to an Entity List

I want to hide/show the button depending on a specific column value of each row.

The red below code works on the ID of the row = ????, but I need to replace the data-id with a whole number column called [Count] so that if this [Count] column is 0 it wont display the button, anything above it will

$(document).ready(function () {

$(".entitylist.entity-grid").on("loaded", function () {

$(this).children(".view-grid").find("tr[data-id]").each(function (i, e){
var id = $(this).attr("data-id");

if ($(this).attr("data-id") == "996b793b-f675-ec11-8943-00224807089a"){
$(this).append("<td><input type='button' style='background-color:lightgreen' onclick='callPowerAutomateInPerson(\"" + id + "\");' value='Attend The Gym' /></td>");
}
});
});
});
  • Suggested answer
    Manoj Mane Profile Picture
    Manoj Mane 1,012 on at
    RE: Portal Entity List Show/Hide Custom Button Using Java Script on column value

    Hi,

    If you are using the OOB functionality of the Portal. You can add filter condition on the action button.

    Please refer the below link:-

    www.engineeredcode.com/.../dynamics-365-portal-filter-criteria-and-action-buttons

    Thanks,
    Manoj.

    Please mark this as VERIFIED if it helps.

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans