ZOHO Desk Extenstion - Getting Account ID

ZOHO Desk Extenstion - Getting Account ID

Hi, I am trying to create a simple extension for ZOHO desk so that our team can quickly navigate to the accounts and contact records in ZOHO CRM that are linked to the ticket. 

I have gone through the API documentation but cannot seem to get it to work.

Any help would be appreciated

Here is the code I have so far (I have omitted our org number and the CSS)

Hi, I am trying to create a simple extension for ZOHO desk so that our team can quickly navigate to the accounts and contact records in ZOHO CRM that are linked to the ticket. 

I have gone through the API documentation but cannot seem to get it to work.

Any help would be appreciated

Here is the code I have so far (I have omitted our org number and the CSS)

<body>
<div class="stacker">
<a role="button" class="button-name" id="crmAccountButton">CRM Account</a>
<button role="button" class="button-name">CRM Contact</button>
</div>

<script type="text/javascript">
  window.onload = function() {
ZOHODESK.extension.onload().then((App) => {
ZOHODESK.get('ticketForm.accountId').then(function(response) {
if (response.status === 'success') {
var accountId = response['ticketForm.accountId'].id;
var accountName = response['ticketForm.accountId'].name;

var crmAccountButton = document.getElementById('crmAccountButton');
if (crmAccountButton) {
crmAccountButton.href = 'https://crm.zoho.eu/crm/org/tab/Accounts/' + accountId;
crmAccountButton.textContent = 'CRM Account: ' + accountName;
}
} else {
console.error('Error retrieving account information:', response);
}
}).catch(function(err) {
console.error('Error:', err);
});
}) 
  }
</script>
</body>
    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方