Create a html page and show the accounts mark ref color for city equals to Dallas , show in left navigation form

Create a html page and show the accounts mark ref color for city equals to Dallas , show in left navigation form

 <html lang="en">

<head>

</head>

<body>

    <div id="accountList"></div>


    <script>

        function getAccountCity() {

            var accountList = document.getElementById("accountList");

            parent.Xrm.WebApi.online.retrieveMultipleRecords("account", "?$select=name,address1_city").then(

                function success(results) {

                    console.log(results);

                    for (var i = 0; i < results.entities.length; i++) {

                        var result = results.entities[i];

                         // Columns

                        var accountCITY = result["address1_city"];

                        var name = result["name"]                      

 

                        const cityElement = document.createElement("p");

                        cityElement.textContent = name;


                        if (accountCITY.toLowerCase()==="dallas") {

                            cityElement.style.color = 'red';

                        }

                        accountList.appendChild(cityElement);

                    }               

                },

                function (error) {

                    console.log(error.message);

                }

            );

        // Assume this function retrieves the account city from the server/database

  

    }

        getAccountCity();

    </script>

</body>

</html>



Comments

Popular posts from this blog

If any case created, then check for the same user how many cases are created with in 30 days, if more than 2 and less than 5 send a mail to team lead, if more than 5 and less than 9 then send a mail to manager using power automate.

Create approve & reject ribbon buttons, once click on approve it should change the status field to approve.If clicked on reject it should change to Reject. Based on status field change trigger work flow to send a email to stating request is approved/Rejected.

How to get and set values in plugins?