Skip to content

Outbound calls not finding contact information for auto call logging #47

@byronsanchez

Description

@byronsanchez

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:

https://github.com/ringcentral-tutorials/ringcentral-web-widget-demos/blob/eb60f258e010dd236bb8f5b05ea8344374ef287b/docs/salesforce_lightning_more/code/RCPhone.vfp#L69

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!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions