Newer Version Available
describeSoftphoneLayout()
Syntax
1DescribeSoftphoneLayoutResult[] = connection.describeSoftphoneLayout();Usage
Use this call to obtain information about the layout of a Softphone. Use only in the context of Salesforce CRM Call Center; do not call directly from client programs.
Arguments
This call does not take any objects.
Response
| Name | Type | Description |
|---|---|---|
| callTypes | DescribeSoftphoneLayoutCallType[] | A set of attributes associated with each allowed call type. A call type may be Inbound, Outbound, or Internal. |
| id | ID | ID of layout. Note that layout objects are not exposed via the API. |
| name | string | Name of the call type: Inbound, Outbound, or Internal. |
DescribeSoftphoneLayoutCallType
Each DescribeSoftphoneLayoutResult object contains one or more call types:
DescribeSoftphoneLayoutInfoField
An information field in the softphone layout.
| Name | Type | Description |
|---|---|---|
| name | string | The name of an information field in the softphone layout that does not correspond to a Salesforce object. For example, caller ID may be specified in an information field. Information fields hold static information about the call type. |
DescribeSoftphoneLayoutSection
Each call type returned in a DescribeSoftphoneLayoutResult object contains one section for each call type. Each section contains object-item pairs:
| Name | Type | Description |
|---|---|---|
| entityApiName | string | The name of an object in the Salesforce application that corresponds to an item displayed in the softphone layout, for example, a set of accounts or cases. |
| items | DescribeSoftphoneLayoutItem[] | A set of softphone layout items. |
DescribeSoftphoneLayoutItem
Each layout item corresponds to a record in Salesforce:
| Name | Type | Description |
|---|---|---|
| itemApiName | string | The name of a record in the Salesforce application that corresponds to an item displayed in the softphone layout, for example, the Acme account. |
DescribeSoftphoneScreenPopOption
Each call type returned in a DescribeSoftphoneLayoutResult object contains one screenPopOptions field for each call type. Each screenPopOptions field contains details about screen pop settings:
| Name | Type | Description |
|---|---|---|
| matchType | string | Setting on a softphone layout to pop a screen for call details that match a single record, multiple records, or no records. |
| screenPopData | string | Setting on a softphone layout for a specific object or page to pop for a call's matchType. For example, pop a specified Visualforce page when the details of a call match a record. |
| screenPopType | picklist | Setting that specifies how to pop a screen for a call's matchType. For example, pop a detail page or don't pop any page when the details of a call match a record. |
Sample Code—Java
This sample describes the soft phone layout and writes its properties to the console. It then gets the allowed call types. For each call type, it gets its information fields, layout sections, and the layout items in the layout sections. It writes these values to the console.
1public void describeSoftphoneLayout() {
2 try {
3 DescribeSoftphoneLayoutResult result =
4 connection.describeSoftphoneLayout();
5 System.out.println("ID of retrieved Softphone layout: " +
6 result.getId());
7 System.out.println("Name of retrieved Softphone layout: " +
8 result.getName());
9 System.out.println("\nContains following " +
10 "Call Type Layouts\n");
11 for (DescribeSoftphoneLayoutCallType type :
12 result.getCallTypes()) {
13 System.out.println("Layout for " + type.getName() +
14 " calls");
15 System.out.println("\tCall-related fields:");
16 for (DescribeSoftphoneLayoutInfoField field :
17 type.getInfoFields()) {
18 System.out.println("\t\t{" + field.getName());
19 }
20 System.out.println("\tDisplayed Objects:");
21 for (DescribeSoftphoneLayoutSection section :
22 type.getSections()) {
23 System.out.println("\t\tFor entity " +
24 section.getEntityApiName() +
25 " following records are displayed:"
26 );
27 for (DescribeSoftphoneLayoutItem item :
28 section.getItems()) {
29 System.out.println("\t\t\t" + item.getItemApiName());
30 }
31 }
32 }
33 } catch (ConnectionException ce) {
34 ce.printStackTrace();
35 }
36}Sample Code—C#
This sample describes the soft phone layout and writes its properties to the console. It then gets the allowed call types. For each call type, it gets its information fields, layout sections, and the layout items in the layout sections. It writes these values to the console.
1/// Demonstrates how to retrieve the layout information
2/// for a Salesforce CRM Call Center Softphone
3public void DescribeSoftphoneLayoutSample()
4{
5 try
6 {
7 DescribeSoftphoneLayoutResult dsplResult = binding.describeSoftphoneLayout();
8
9 // Display the ID and Name of the layout
10 Console.WriteLine("ID of retrieved Softphone layout: {0}", dsplResult.id);
11 Console.WriteLine("Name of retrieved Softphone layout: {0}", dsplResult.name);
12
13 // Display the contents of each Call Type
14 Console.WriteLine("\nContains following Call Type Layouts\n");
15 foreach (DescribeSoftphoneLayoutCallType dsplCallType in dsplResult.callTypes)
16 {
17 Console.WriteLine("Layout for {0} calls", dsplCallType.name);
18
19 // Display the call-related fields contained in the call type
20 Console.WriteLine("\tCall-related fields:");
21 foreach (DescribeSoftphoneLayoutInfoField dsplInfoField
22 in dsplCallType.infoFields)
23 {
24 Console.WriteLine("\t\t{0}", dsplInfoField.name);
25 }
26
27 // Display the objects that are included in the layout
28 Console.WriteLine("\tDisplayed Objects:");
29 foreach (DescribeSoftphoneLayoutSection dsplSection
30 in dsplCallType.sections)
31 {
32 Console.WriteLine("\t\tFor entity {0} following records are displayed:",
33 dsplSection.entityApiName);
34 foreach (DescribeSoftphoneLayoutItem dsplItem in dsplSection.items)
35 {
36 Console.WriteLine("\t\t\t{0}", dsplItem.itemApiName);
37 }
38 }
39 }
40 }
41 catch (SoapException e)
42 {
43 Console.WriteLine(e.Message);
44 Console.WriteLine(e.StackTrace);
45 Console.WriteLine(e.InnerException);
46 }
47}