dynamics-crmdynamics-crm-2011microsoft-dynamicsdynamics-crm-2013

MS Dynamics - Microsoft.CIFramework.addHandler is not invoked - onpagenavigate and onclicktoact


I am integrating my call center widget application to dynamics 365 crm. I am using Channel integration framework(Microsoft.CIFramework).

Imported library: enter image description here

I am registering handler for events such as onpagenavigate and onclicktoact as per documentation.

Microsoft.CIFramework.addHandler("onpagenavigate", handlerFunction).then(
            function success(result) {
                console.log(result);
            },
            function (error) {
                console.log(error.message);
                // handle error conditions
            });
 var handlerFunction = function(eventData) {
            return new Promise(function (resolve, reject){
                try{
                    console.log(eventData)
                    return resolve();
                }catch(error){
                    return reject();
                }  
            })
            }

But my handler function is not getting invoked.

I could see the error in console one any page navigation. enter image description here

I debugged the library code, i could find error on addhandler registration. enter image description here

Please help me what i am missing here.


Solution

  • I have resolved this issue with the simple configuration.

    While configuring the channel integration framework provider, you need to give the domain where the events need to be posted by dynamics in trusted domain field.

    I have given my app domain in the trusted domain field and registered the addhandler for opagenavigate in my app.

    enter image description here