Skip to content

Instantly share code, notes, and snippets.

CustomPickList__mdt[] results = [SELECT LabelName__c FROM CustomPickList__mdt];
for(CustomPickList__mdt val : results){
System.debug('ラベル名=' + val.LabelName__c);
}
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>CustomPickList__mdt.Code__c</members>
<members>CustomPickList__mdt.DisplayNum__c</members>
<members>CustomPickList__mdt.LabelName__c</members>
<name>CustomField</name>
</types>
<types>
<members>CustomPickList.Value01</members>
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<description>カスタム選択リストのラベル02のレコードです。</description>
<label>ラベル02</label>
<values>
<field>Code__c</field>
<value xsi:type="xsd:string">P02</value>
</values>
<values>
<field>DisplayNum__c</field>
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<description>カスタム選択リストのラベル01のレコードです。</description>
<label>ラベル01</label>
<values>
<field>Code__c</field>
<value xsi:type="xsd:string">P01</value>
</values>
<values>
<field>DisplayNum__c</field>
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<fields>
<fullName>Code__c</fullName>
<externalId>false</externalId>
<label>コード値</label>
<length>255</length>
<required>false</required>
<type>Text</type>
<unique>false</unique>
@isanuki
isanuki / AnalyticsAPISample.page
Last active December 30, 2015 13:59
Visualforce Analytics API Highcharts Sample
<apex:page showHeader="false">
<!-- 必要なライブラリを読み込む -->
<apex:includeScript value="//code.jquery.com/jquery-1.10.1.min.js" />
<apex:includeScript value="{!$Resource.highcharts}" />
<apex:includeScript value="{!$Resource.forcetk}" />
<script type="text/javascript">
$j = jQuery.noConflict();
var repot = null;
<?xml version="1.0" encoding="UTF-8"?>
<CustomObjectSharingRules xmlns="http://soap.sforce.com/2006/04/metadata">
<ownerRules>
<fullName>Acct1toAcc2</fullName>
<sharedTo>
<portalRoleAndSubordinates>CustomerUser1</portalRoleAndSubordinates>
</sharedTo>
<sharedFrom>
<portalRoleAndSubordinates>CustomerUser2</portalRoleAndSubordinates>
</sharedFrom>
@isanuki
isanuki / TerraSkyTechBlog20130417_007
Last active December 15, 2015 23:59
SOQL 日付リテラル サンプル
Account[] accounts = [SELECT Name
FROM Account
WHERE LastModifiedDate = THIS_WEEK];
@isanuki
isanuki / TerraSkyTechBlog20130417_006
Last active December 15, 2015 23:59
SOQL 日付関数サンプル
AggregateResult[] results = [SELECT FISCAL_YEAR(CloseDate) year,
SUM(Amount) summary
FROM Opportunity
WHERE IsWon = true
GROUP BY FISCAL_YEAR(CloseDate)];
for(AggregateResult ar: results){
System.debug('年度='+ ar.get('year')
+ ':金額='+ ar.get('summary'));
}
@isanuki
isanuki / TerraSkyTechBlog20130417_005
Last active December 15, 2015 23:59
SOQL 日付関数サンプル
Account[] accounts = [SELECT Name
FROM Account
WHERE CALENDAR_YEAR(CreatedDate) = 2012];