Skip to content

Instantly share code, notes, and snippets.

View tyoshikawa1106's full-sized avatar
🇯🇵
TOKYO

Taiki Yoshikawa tyoshikawa1106

🇯🇵
TOKYO
View GitHub Profile
@tyoshikawa1106
tyoshikawa1106 / SidebarViewPage.page
Last active December 17, 2015 11:49
サイドバーにVisualforceページを表示。背景透過。
<apex:page showHeader="false" sidebar="false" id="page">
<style type="text/css" media="all">
body{background-color:transparent;}
</style>
<apex:form id="form">
<apex:outputText value="・・・・・・・・・・・・・・・・・・・・・・・・" /><br/>
<apex:outputText value="・・・・・・・・・・・・・・・・・・・・・・・・" /><br/>
<apex:outputText value="・・・・・・・・・・・・・・・・・・・・・・・・" /><br/>
<apex:outputText value="・・・・・・・・・・・・・・・・・・・・・・・・" /><br/>
<apex:outputText value="・・・・・・・・・・・・・・・・・・・・・・・・" /><br/>
@tyoshikawa1106
tyoshikawa1106 / GoogleSearch.html
Last active December 17, 2015 11:49
Google検索窓の表示
<!-- Google -->
<form method="GET" action="http://www.google.co.jp/search" target="_blank" >
<table><tr><td>
<a href="http://www.google.co.jp/"></a>
<input type=text name=q size=21 maxlength=255 value="">
<input type=hidden name=ie value="UTF-8">
<input type=hidden name=oe value="UTF-8">
<input type=hidden name=hl value="ja">
<input type=submit value="検索">
</td></tr></table>
@tyoshikawa1106
tyoshikawa1106 / EventCustomButton
Last active December 17, 2015 18:18
Event Custom Button Add Google Calendar
https://www.google.com/calendar/render
?action=TEMPLATE
&text={!Event.Subject}
&dates={!SUBSTITUTE(TEXT(DATEVALUE(Event.StartDateTime)), '-', '')}T{!MID( SUBSTITUTE(TEXT(Event.StartDateTime), ':', ''), 12, 6 )}Z/{!SUBSTITUTE(TEXT(DATEVALUE(Event.EndDateTime)), '-', '')}T{!MID( SUBSTITUTE(TEXT(Event.EndDateTime), ':', ''), 12, 6 )}Z
&details={!Event.Description}
&location={!Event.Location}
&trp=false
&sf=true
&output=xml
<apex:page showHeader="true" sidebar="false">
<apex:includeScript value="{!$Resource.shortcut}" />
<apex:form >
<apex:outputText value="Ctrl+Shift+X Click!!" />
<br/>
<br/>
<apex:outputText value="Ctrl+Shift+Y Click!!" />
<br/>
<br/>
<apex:outputText value="Ctrl+Shift+Z Click!!" />
@tyoshikawa1106
tyoshikawa1106 / お知らせ
Last active December 17, 2015 20:59
ホームページコンポーネントのお知らせ・JavaScriptショートカットキー処理のデモ
<script type="text/javascript" src="/resource/shortcut"></script>
<script>
shortcut.add("Ctrl+Shift+1",function() {
window.open('/_ui/common/apex/debug/ApexCSIPage', null);
});
shortcut.add("Ctrl+Shift+2",function() {
window.open('/setup/forcecomHomepage.apexp?setupid=ForceCom', null);
});
shortcut.add("Ctrl+Shift+3",function() {
window.open('http://www.salesforce.com/us/developer/docs/pages/index.htm', null);
@tyoshikawa1106
tyoshikawa1106 / UserCreateSample.cls
Last active December 17, 2015 22:59
テストクラスでユーザ作成時にライセンス数の制限が影響するかのテスト
public with sharing class UserCreateSample {
public UserCreateSample() {
}
public User getUser(Profile prmProfile, String prmEmail, Integer prmUserNo) {
// ユーザ
User user = new User();
// 姓
@tyoshikawa1106
tyoshikawa1106 / mobileStyleMeta.html
Created June 1, 2013 12:28
スマートフォン用レイアウトに変換できるメタタグ
<meta name="viewport" content="width=device-width, user-scalable=no"/>
@tyoshikawa1106
tyoshikawa1106 / GoogleMapPage.page
Last active December 18, 2015 01:58
VisualforceとGoogleMap
<apex:page standardController="Account" showHeader="false" sidebar="false">
<head>
<base target="_blank"/>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript"
src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
// 緯度・経度取得
var latlng = new google.maps.LatLng({!account.LatLngTt__c});
@tyoshikawa1106
tyoshikawa1106 / ContantDownload.js
Created June 5, 2013 16:58
コンテンツダウンロードのJavaScript
// コンテンツダウンロード
function openDownloadWindow(prmId) {
url = "/sfc/servlet.shepherd/version/download/" + prmId;
// ポップアップ表示メソッド呼び出し
window.open(url,'','width=700,height=500');
return false;
}
@tyoshikawa1106
tyoshikawa1106 / TryCatchDemo.cls
Last active December 18, 2015 07:49
try-catch処理のサンプル
try {
/* INSERT等の処理 */
} catch (DmlException e) {
/* Dml処理でのException処理をcatch
入力規則等でのエラーもcatchできる */
} catch (Exception e) {
/* その他のExceptionエラーをcatch */
}