deejay-hub / timeline-lwc

:octocat: An interactive timeline for the Salesforce platform.
https://dave-norris.medium.com/
MIT License
266 stars 72 forks source link

Add indirect relationships to Voice Calls for Account and Opportunity #269

Closed Sam-Sriram closed 9 months ago

Sam-Sriram commented 1 year ago

The Configuration guide says the Warp timeline supports lookup and master detail relationships. And the FAQ states that indirect relationships are supported.

The voice calls uploaded against a contact or Opportunity (associated with the contact) show under the Activity for the Opportunity.

We would like the Voice calls to be plotted in the Warp timeline. The voice call is associated with an activity (task) and also has a RelatedRecord lookup that can be Contact, Opportunity, Account, etc.

I created a custom metadata type to add a relationships between Opportunity (Parent) and Voicecall (as child). While it appears in the filter on the Timewarp, selecting it does not plot the voicecall object on the timeline. '

Please see the various screenshots in attached document.

Not sure if this is an issue with how I have configured or a bug or an enhancement request, Can you please review and advise?

Cheers Sam sam.sriram@ofx.com TimeWarp issue in GitHub.docx

github-actions[bot] commented 1 year ago

Hello @Sam-Sriram , thank you for submitting an issue we appreciate your time. We will take a look and give you an update as soon as we can. We aim for a 72 hour response time.

deejay-hub commented 1 year ago

Hi @Sam-Sriram. Time Warp can plot direct relationships to the VoiceCall object. It's not immediately apparent to me but it looks like the Voice Call records you're trying to plot are not directly linked to the Opportunity. It looks like they are linked to a Contact that is linked to the Opportunity. This is an indirect relationship that Time Warp doesn't support outside of standard Tasks, Events and Calls.

The related record field on the VoiceCall record would need to be the Opportunity

image

This would then plot successfully.

The standard timeline plots indirect relationships for Voice Calls which is why there is a mismatch. We have no plans to add this capability to Time Warp but someone in the community can send a pull request if they wish to address it. We'll leave this open for 3 months but if no-one picks it up we'll close it.

Sam-Sriram commented 1 year ago

VoiceCalls.json Thanks Dave

I have attached the list of voice calls in my sandbox (SELECT FIELDS(All) FROM voicecall ) and as you can see there is a mix of Account, Opportunity and Contact as Related records.

I added the Time Warp component to both Account and Contact and it does not plot the VoiceCall in either view, thoigh they appear in the respective Activity tab. Have included snippets of the Account page in the post

image image image

Am I missing something in my Timeline configuration?

Cheers

deejay-hub commented 1 year ago

It's best if you give me the steps to recreate. It's easier to follow. Here's what I do using v1.12.

Testing for Contact. Step 1: Create a new Contact. I'll call them Test One. This way they have no existing records.

image

Step 2. Setup timeline metadata to look for any VoiceCalls where the Contact is in the RelatedRecords lookup. Use the call icon.

image

Step 3. Add Time Warp the Test One's contact page layout. Leave all Time Warp settings in App Builder to be the default then Save and Activate the page.

image

Step 4. Create a Voice Call record. Populate the Contact record with the phone number you are going to dial. That way the Voice Call record is auto associated to the Contact

image

Check that the related record on the VoiceCall is for the Contact we created in Step 1 (Test One)

image

Step 5. Refresh Time Warp to check that the task and VoiceCall records are logged.

image

Can you recreate and let me know what you find? As you can see I can view the VoiceCall record.

Sam-Sriram commented 1 year ago

Thanks Dave. I had created the voicecall using the REST API endpoint URL {connect-base-url}/voicecalls (as described here https://help.salesforce.com/s/articleView?id=000392584&type=1.)

The input payload defined has the recordID as a mandatory as below:

recordId | String |   | At least one is required | (001/003/00Q)xxxxxxxxxxxx | Salesforce Record Id (Account/Contact/Leads)

and I have been using either Account, Opportunity or Contact for the recordId. This is on my sandbox environment that has no CTI integration, only simulation.

Will start from scratch and recreate with a new Contact and Opportunity and log voice calls against both contact and opportunity. Also, ensure that From and To phonenumbers on the Voice call payload are populated corresponding to the Contact details.

One question from your example. The voice call screenshot shows blank Activity logged against it, but on the timeline the Voicecall does show up under a task. Is that a product feature?

Cheers

deejay-hub commented 1 year ago

I'm not the best person to ask how inbound and outbound voice works. All I can say is that in my test, for outbound calls Salesforce creates a separate Task and VoiceCall record as seen in the standard Timeline and Time Warp above.

Sam-Sriram commented 1 year ago

Hi David

I have redone the tests (3) and attached has the sequence of steps . The Voicecalls still don't appear in the timeline though they are shown in the Activity tab of the Contact and Opportunity

Cheers TimeWarp issue - Recreation steps.docx

deejay-hub commented 1 year ago

Can you provide screenshots of the VoiceCall records? That is missing. We need to see the Related Record field for each.

Sam-Sriram commented 1 year ago

Oops, forgot about those

1st VoiceCall (against Contact and not linked to Task)

image

2nd Voice Call (against Opportunity and linked to Task) image

3rd Voice Call (against Contact and linked to same task) image

Sam-Sriram commented 1 year ago

TimeWarp version image

Sandbox is on Winter '24 Patch 12.2

deejay-hub commented 1 year ago

Okay thanks. One more thing. Can you run this query replacing ContactId with the Contact you created in your test.

SELECT Id, (SELECT Id, CallDisposition, CallConnectDateTime from RelatedRecords) FROM Contact WHERE ID = ''

and copy and paste the results from the RelatedRecords column in the output?

Sam-Sriram commented 1 year ago

Here it is. I can see CallConnectDateTime is null, which may be the issue? Let me try CallStartDateTime and CallType (instead of Disposition)

{ "totalSize": 1, "done": true, "records": [ { "attributes": { "type": "Contact", "url": "/services/data/v57.0/sobjects/Contact/0032300000c3N7wAAE" }, "Id": "0032300000c3N7wAAE", "RelatedRecords": { "totalSize": 2, "done": true, "records": [ { "attributes": { "type": "VoiceCall", "url": "/services/data/v57.0/sobjects/VoiceCall/0LQ230000002qnpGAA" }, "Id": "0LQ230000002qnpGAA", "CallDisposition": null, "CallConnectDateTime": null }, { "attributes": { "type": "VoiceCall", "url": "/services/data/v57.0/sobjects/VoiceCall/0LQ230000002qnzGAA" }, "Id": "0LQ230000002qnzGAA", "CallDisposition": null, "CallConnectDateTime": null } ] } } ] }

deejay-hub commented 1 year ago

Looks like you're asking to plot CallConnectDateTime in the metadata but you are not populating this in your API call. Perhaps change it to CallStartDateTime in the metadata then log out/log in and refresh Time Warp.

Since it has no value Time Warp doesn't know where to plot it.

Sam-Sriram commented 1 year ago

Shows the call now. Thanks Dave

image

Sam-Sriram commented 1 year ago

Also on the Opportunity, shows the Call it was linked to

image

deejay-hub commented 1 year ago

Glad to hear. Is there anything else or can we close the issue? @Sam-Sriram

Sam-Sriram commented 1 year ago

Thanks @deejay-hub In the initial response, you had mentioned while there is no plan to support the indirect relationships for voice calls, you could leave it open for 3 months in case someone in the community could add that feature and close it if not picked up. Is that still an option?

deejay-hub commented 1 year ago

Since Winter '24 Salesforce have added Voice Calls to the standard timeline. Time Warp supports plotting direct relationships to these records. The standard Timeline also plots indirect relationships for Account and Opportunity. This means that the standard timeline plots any Voice Call that is related to ANY contact (Account) or related Contact (Opportunity). Time Warp supports indirect relationships for Task, Event and Call via Open Activities and Activity History relationships but Voice Call operates differently.

The ask is to query for all contacts and related contacts then query the Voice Call object where their Id exists in the RelatedRecordId field on VoiceCall.

deejay-hub commented 9 months ago

Closing due to inactivity