1
votes

I am trying to relate phone calls to multiple records in Salesforce. The records are in two different custom objects, but you can think of the records like a Lead or an Opportunity. Our salespeople call multiple people (Leads) for given Opportunities, and I'd like to capture both pieces of information.

Is this possible in Salesforce? My current layout has a "Related To" tab that populates when you navigate to a given record, but it forces you to choose one record before auto-saving. Is it possible to have a format that maps the Activity generated by the call to multiple records?

This could be a format with multiple drop-down "Relate To" menus. Better yet, I could use a field that allows you type a record number in to to a free-response field to relate it to an Opportunity.

Thanks!

Austin

P.S. We are running Salesforce Professional with API. We are using a CTI adapter from BroadSoft.

3

3 Answers

0
votes

I don't know the BroadSoft adapter and I couldn't find it on Salesforce AppExchange to give it a test run. But assuming it's a typical plugin for Salesforce, you'll have little control over it (i.e. cannot add a helper junction object that would act like many-to-many relationship bridge).

You should have no problems writing a piece of Visualforce to suit your needs though (especially the later requirement - use some text filter to display list that matches this filter).

I'll write a quick example. My business requirement for the sake of this example is "I want to show all Activities whose Subject field matches text I've put on new field in Opportunity, regardless whether they are linked or not. This should appear as similar to normal related list on Opportunity".

  1. Add text field called "record" to your Opportunity object.
  2. Create an Apex class:

    public class AustinTest { private Opportunity o;

    public AustinTest(ApexPages.StandardController controller) {}
    
    public List<Event> getActivities() {
        Opportunity o = [SELECT Id, Record__c 
            FROM Opportunity 
            WHERE Id = :ApexPages.currentPage().getParameters().get('id')];
    
        String searchTerm = '%' + o.Record__c + '%';
        return [SELECT Id, Subject, Type FROM Event WHERE Subject LIKE :searchTerm];
    }
    

    }

  3. Create a Visualforce Page:

    <apex:page standardController="Opportunity" extensions="AustinTest"> <apex:pageBlock> <apex:pageBlockTable value="{!activities}" var="a"> <apex:column value="{!a.Id}" /> <apex:column value="{!a.Subject}" /> <apex:column value="{!a.Type}" /> </apex:pageBlockTable> </apex:pageBlock> </apex:page>

  4. Go to the Page Layout editor for Opportunities and drop the Visualforce somewhere on the page. We have to drop it in the "detail" area (like normal fields, not like Related Lists), that's fine for now.

  5. Experiment with it, decide if it's worth spending time on. With extra bit of tweaking we can make it display similar to normal Related List. I'll write more if needed. How would you like to have this list of matching records accessible anyway? As a separate tab? Related List? Something else?

0
votes

Is it possible to have a format that maps the Activity generated by the call to multiple records? This could be a format with multiple drop-down "Relate To" menus.

The most concise answer: no. The drop down list and association is not modifiable.

There are ways to do this, but it requires either customization, eyescream post- it has some great info on how to do that. And you may need your CTI vendor to do portions of the customization.

Note: make sure you use CTI 2.0+ (preferably CTI 3.0+). This has lots of improved features for improving call logging and handling. See the wiki here:

http://wiki.developerforce.com/index.php/CTI_Toolkit

0
votes

Are the calls stored in their own object? If so, you could add lookup fields that look up to each object you want to link to the call. If the calls aren't saved in their own object, I would recommend using a custom object to store them in as separate records. You can use lookup fields to link them to whatever objects you want, and you can display them as items in a related list on the record pages of those objects.

As an example, say I have a custom object called "Calls". The object would contain the following fields:

  • Call name (text field)
  • Opportunity (lookup field)
  • Lead (lookup field)
  • etc...

Then you can add a "Calls" related list to both Opportunities and Leads, and all call records that look up to that Lead or Opportunity record will be displayed in the list on both records.

Hope this helps!