This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class displaySObjectList { | |
public Map<String, List<String>> stdObj = new Map<String, List<String>>(); | |
public Map<String, List<String>> cstmObj = new Map<String, List<String>>(); | |
public Map<String, List<String>> getStdObject(){ | |
return stdObj; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page showHeader="true" sidebar="true" controller="displaySObjectList"> | |
<p>Sobjectのリストを取得してオブジェクト名とプレフィックスを表示します</p> | |
<p>プレフィックスがnullのものは表示されません</p> | |
<div> | |
<apex:form> | |
<apex:commandButton value="display" action="{!CreateObjectList}" reRender="result"/> | |
</apex:form> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public pageReference feedWithMention(){ | |
ConnectApi.FeedItemInput feedItemInput = new ConnectApi.FeedItemInput(); | |
ConnectApi.MentionSegmentInput mentionSegmentInput = new ConnectApi.MentionSegmentInput(); | |
ConnectApi.MessageBodyInput messageBodyInput = new ConnectApi.MessageBodyInput(); | |
ConnectApi.TextSegmentInput textSegmentInput = new ConnectApi.TextSegmentInput(); | |
messageBodyInput.messageSegments = new List<ConnectApi.MessageSegmentInput>(); | |
// メンション先のユーザを指定 | |
User u = [SELECT Id FROM User WHERE Name = 'testUser' LIMIT 1]; | |
mentionSegmentInput.id = u.Id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class ContactSampleExtension { | |
private final Contact cont; | |
public String selected {get; set;} | |
public ContactSampleExtension(ApexPages.StandardController stdController) { | |
this.cont = (Contact)stdController.getRecord(); | |
} | |
public List<SelectOption> getItems(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page showHeader="true" sidebar="true" standardController="Contact" extensions="ContactSampleExtension"> | |
<p>This is ContactSample page(VF)</p> | |
<!-- 選択肢を表示 --> | |
<apex:form> | |
<div style="width: 20%;"> | |
<apex:selectRadio value="{!selected}" layout="pageDirection" borderVisible="true" legendText="選択肢サンプル"> | |
<apex:selectOptions value="{!items}"/> | |
</apex:selectRadio> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 検索元のContact | |
Contact c = new Contact(); | |
c.LastName = 'con'; | |
c.Phone = '0311111111'; | |
// SOSLを実行 | |
List<List<SObject>> searchList = [FIND :c.Phone IN Phone FIELDS RETURNING Account(Name, Phone), Contact(Name, Phone)]; | |
Account[] acList = ((List<Account>)searchList[0]); | |
Contact[] cList = ((List<Contact>)searchList[1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<List<SObject>> searchList = [FIND '*test*' IN NAME FIELDS RETURNING Account(Id, Name), Contact]; | |
Account[] ac = ((List<Account>)searchList[0]); | |
Contact[] co = ((List<Contact>)searchList[1]); | |
System.debug(ac[0].Name); | |
System.debug(co[0].Name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 都道府県と緯度経度を格納するMap | |
Map<String, Location> prefs = new Map<String, Location>(); | |
// 北海道 | |
Location hokkaido = Location.newInstance(43.063968, 141.347899); | |
prefs.put('北海道', hokkaido); | |
// 青森県 | |
Location aomori = Location.newInstance(40.824623, 140.740593); | |
prefs.put('青森県', aomori); | |
// 岩手県 | |
Location iwate = Location.newInstance(39.703531, 141.152667); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('.content').collapser({ | |
mode: 'chars', | |
truncate: 10, | |
showText: '続きを読む', | |
hideText: '隠す' | |
}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page> | |
<h1>This is sampleCode</h1> | |
</apex:page> |