[Salesforce] 弹出 窗口

Quickstart: Creating Custom Screen Pops Using Visualforce

This is part of the Developing with Service & Support Quickstarts

Use Case

The time that agents spend clicking through Service & Support is often scrutinized closely. Companies want to enable their agents to be as productive as possible, so if there's a way that few clicks and a few seconds can be saved, it's usually worth investigating. With the release of Spring '10 and CTI Toolkit 2.0, customers can now configure their CTI adapters to pop to a custom Visualforce page to enable the agent to be directed to the right page quickly.

See the blog post corresponding to this quick start for more information and pretty pictures.

Background

Note that this code will only work with CTI adapters developed on the CTI Toolkit 2.0 and later. To find out which CTI Toolkit your adapter was built with, run the adapter, right-click the S-phone icon in the system tray, and click About... The Call Center Edition version corresponds to the CTI Toolkit version.

If you are running an adapter built on an earlier version of the CTI Toolkit, you may want to ask your vendor if they offer a newer version.

To configure your adapter to pop to a Visualforce page, modify the Softphone Layout at Setup | Customize | Call Centers | Softphone Layouts.

Sample Code:

This sample Visualforce page accepts the information that CTI provides on the querystring of the URL and generates a page that searches for Contacts and Accounts. Admittedly, this is not a terribly useful page to pop, particularly since you can also pop a standard search screen that does the same thing, but it does serve to demonstrate how you might use the information provided by the CTI adapter to pop information that is relevant to your agents.

Visualforce page:

01<apex:page controller="SearchPageController">
02   <apex:pageBlock title="Contacts">
03      <apex:pageBlockTable value="{!contacts}" var="contact">
04         <apex:column headertitle="Name"><a href="/{!contact.Id}"><apex:outputText value="{!contact.Name}" /></a>
05         </apex:column>
06         <apex:column value="{!contact.MailingCity}"/>
07         <apex:column value="{!contact.Phone}"/>
08      </apex:pageBlockTable>
09   </apex:pageBlock>
10   <apex:pageBlock title="Accounts">
11      <apex:pageBlockTable value="{!accounts}" var="account">
12         <apex:column headertitle="Name"><a href="/{!account.Id}"><apex:outputText value="{!account.Name}" /></a>
13         </apex:column>
14         <apex:column value="{!account.BillingCity}"/>
15         <apex:column value="{!account.Phone}"/>
16      </apex:pageBlockTable>
17   </apex:pageBlock>
18</apex:page>

Controller:

01public class SearchPageController {
02    public List<Account> accounts {get; private set;}
03    public List<Contact> contacts {get; private set;}
04 
05    public SearchPageController() {
06        String callerId = ApexPages.currentPage().getParameters().get('ANI');
07        List<List<SObject>> searchList = [FIND :callerId IN PHONE FIELDS RETURNING Account(Id, Name,BillingCity,Phone), Contact(Id, Name,MailingCity,Phone)];
08 
09        if (searchList!=null) {
10            accounts = ((List<Account>)searchList[0]);
11            contacts = ((List<Contact>) searchList[1]);
12        }
13    }
14}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值