Salesforce: Buttons - Mass delete / get ids / show google maps
来源:互联网 发布:mac口红日本官网 编辑:程序博客网 时间:2024/06/04 19:02
Mass Delete
This example creates a button that can be added to activity related lists and list views, and allows users to delete selected records at the same time.
1 Define a button for events with these atributes:
Display Type─List Button
behavioue - execute javascript
content source - onclick javascript
add this code:
{!REQUIRESCRIPT("/soap/ajax/9.0/connection.js")}
var records = {!GETRECORDIDS( $ObjectType.Event )};
var taskRecords = {!GETRECORDIDS( $ObjectType.Task)};
records = records.concat(taskRecords);
if (records[0] == null) {
alert("Please select at least one record.") }
else {
var errors = [];
var result = sforce.connection.deleteIds(records);
if (result && result.length){
var numFailed = 0;
var numSucceeded = 0;
for (var i = 0; i < result.length; i++){
var res = result[i];
if (res && res.success == 'true'){
numSucceeded++;
} else {
var es = res.getArray("errors");
if (es.length > 0) {
errors.push(es[0].message);
}
numFailed++;
}
}
if (numFailed > 0){
alert("Failed: " + numFailed + "\nSucceeded: " + numSucceeded + " \n Due to: " + errors.join("\n"));
} else {
alert("Number of records deleted: " + numSucceeded);
}
}
window.location.reload();
}
2 add button to activity list views
3 add button to to any page layout that contains an activity related list. The button deletes any selected task or event in the list.
Getting Record IDs
This example creates a button that opens a popup window listing record IDs for user selected records. This is useful when testing to ensure you have the correct record IDs before processing them further.
1 Define a button for events with these atributes:
Display Type─List Button
behavioue - execute javascript
content source - onclick javascript
add this code:
idArray = {!GETRECORDIDS($ObjectType.Contact)};
alert("The Ids you have selected are: "+idArray);
2 add button to to the appropriate related list on a page layout or list view layout.
Get Google Map
This example creates a button that opens a new window showing a google map. This is useful for anyone wanting to make a site visit.
1 define a new button at customise - accounts - actions links buttons with these attributes:
Display Type─Detail Page Button
behavioue - display in new window
content source - URL
add this code:
http://maps.google.com/maps?q={!Account_BillingStreet}%20{!Account_BillingCity}%20{!Account_BillingState}%20{!Account_BillingPostalCode}
2 add button too account page layout
0 0
- Salesforce: Buttons - Mass delete / get ids / show google maps
- Google Maps
- google maps
- Get Record(s) by Ids
- get solib maps
- Get all the coordinates of listed banks from Google Maps with Python 3
- Google Maps API 说明
- baidu & google maps 分析
- Google Maps API
- Google maps切割方法
- Google Maps Hacks
- 学习 Google Maps API
- Powerful Google Maps APIs
- google maps api
- Google Maps 图标
- google maps api 应用
- Google Maps获取经纬度
- Widget與Google Maps
- WEB安全性测试考虑的几个方面
- [Nginx]配置优化详解
- 学习笔记-实验楼项目课(Linux桌面字典)
- Linux相关问题-CentOS6.5 x64版本下Tomcat无法自启动的解决办法
- Reason for - List list = new ArrayList();
- Salesforce: Buttons - Mass delete / get ids / show google maps
- 堆和栈的区别(转过无数次的文章)
- oracle内存的学习
- Xcode 5 单元测试(一)使用XCTest进行单元测试
- html5 好的网站分享
- Ajax异步请求PHP数据
- JDK6 中队web service的支持
- sencha touch 资料记录
- redis操作