Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

CIF listeners not firing

(0) ShareShare
ReportReport
Posted on by 20

Hi,

I am writing some code for the channel integration framework, using a softphone. The Microsoft.CIFramework.searchAndOpenRecords functions are working fine, but I can't seem to get the even handlers working, e.g. click to act and onpagenavigate.

This is the code I am using to start the handlers, but the listener is not starting at all. The initCTI is being written to the log, but nothing else happens. Any help would be appreciated. I am calling the function after the softphone has finished loading.

// JavaScript source code
export function pageNavigateHandler(eventData) {

console.log("eventFired")
console.log(eventData)
return Promise.resolve();
}

export default function initCTI() {
console.log("initCTI");

(function () {
window.addEventListener("CIFInitDone", function () {

console.log("handler startedtest");
Microsoft.CIFramework.addHandler("onpagenavigate", pageNavigateHandler);
console.log("Added handlers for the panel");
//Code that consumes CIF library APIs.
});
})();

}

  • Suggested answer
    abhi5459 Profile Picture
    abhi5459 2 on at
    CIF listeners not firing
    I tried the same thing and found out the issue. The CIFInitDone event is triggered before the web resource's code is loaded. It means that the code which is adding the event listener for CIFInitDone is loaded after the event is triggered from dynamics CIF library, so the event is never captured at all.
     
    Hopefully this will be fixed soon by ms dynamics team. In the meantime, I think we can assume that it is initialised before web resource is loaded.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans