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

Relationship Behaviours in D365 crm

Call Action Through JavaScript

Power Apps Cheat Sheet