-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Dunno if this repo was meant to be like a quick example guide, I'm gonna guess it is. But I wanted to point out some things in case I can get some pointers or maybe someone else is tackling the same problem.
I was playing around with the widgets in salesforce and received the following error after making an outbound call:
RCPhone?mode=Lightning&isdtp=vw&sfdcIframeOrigin=https%3A%2F%2Fna50.lightning.force.com:94 Uncaught TypeError: Cannot read property 'Id' of undefined
at callback (RCPhone?mode=Lightning&isdtp=vw&sfdcIframeOrigin=https%3A%2F%2Fna50.lightning.force.com:94)
at Object.executeCallback (opencti_min.js:1)
at s (opencti_min.js:1)
I did some debugging and basically found this line:
This line is looking for my "from" number instead of the contact's "to" number. Since my number isn't in the contacts database, the searchContacts query in the apex class RCPhoneHelper.apxc finds nothing and ultimately the above error gets thrown out in the Chrome Developer Tools Window. Switching it to var fromNumberE164 = event.data.call.to; made it log the outbound calls as expected.
So my conclusion is that the sample code for automatic call logging is only currently handling the inbound call use case and it's up to individual users to identify their requirements and implement the code they need? (Sounds fair to me, just wanna make sure I'm understanding this right before I try to write all my own stuff!)