Search This Blog

Friday, June 23, 2017

Click Phone Number on HTML page calling with Skype as similar to Dynamics CRM Phone Number

Click Phone Number on HTML page calling with Skype as similar to Dynamics CRM Phone Number

On CRM, we are embedded the HTML page in the contact screen. In HTML page there is a phone number link(anchor tag) button.

When user click the field need to call with Skype as similar to Dynamics CRM.




On the HTML page we have to create a anchor tag

  <a href="callto:768-555-0156" id="iAnchor"  onclick="return Test();" use_skype_protocol_grid="True" country_code="+91" title="Prefix the number with &quot;+<country code><area code>&quot; and install Skype to make calls from Microsoft Dynamics 365.">768-555-0156</a>

Attribute Definitions:
href= callto:Phonenumber
use_skype_protocol_grid= call in skype or skypeBusiness/Lync(Administrator->SystemSetting->Set the telephone provider)
country_code= (Administrator->SystemSetting->Default country/code region)



 function Test() {
  //Syntax        //Mscrm.Shortcuts.openPhoneWindow(phoneNumber,LOCID_COUNTRY_CODE,LOCID_USE_SKYPE_PROTOCOL)

    parent.Mscrm.Shortcuts.openPhoneWindow("768-555-0156", "+91", "true")
 }

The below is the original method in the Dynamics CRM  "_static/_grid/action.js"
//_static/_grid/action.js
function openPhoneNumberFromGrid(e)
{
    try
    {
        var o = e.target || e.srcElement;
        if(!IsNull(o))
        {
            while(o.tagName != "A")
                o = o.parentNode;
            var phoneNumber = XUI.Html.GetText(o),
                LOCID_COUNTRY_CODE = "",
                LOCID_USE_SKYPE_PROTOCOL = "";
            if(!isNullOrEmptyString(phoneNumber))
            {
                if(o.hasAttribute("country_code"))
                    LOCID_COUNTRY_CODE = o.getAttribute("country_code");
                LOCID_USE_SKYPE_PROTOCOL = o.getAttribute("USE_SKYPE_PROTOCOL_GRID");
                Mscrm.Shortcuts.openPhoneWindow(phoneNumber,LOCID_COUNTRY_CODE,LOCID_USE_SKYPE_PROTOCOL)
            }
        }
    }
    catch(e)
    {
    }
    return false
}




No comments:

Post a Comment

Note: Only a member of this blog may post a comment.