Skip to content

Instantly share code, notes, and snippets.

View mokamoto's full-sized avatar

Mitch Okamoto mokamoto

View GitHub Profile
@mokamoto
mokamoto / AccoutListPage.page
Created August 25, 2013 19:30
サンプルのStandard Set Controllerを利用した取引先のリスト表示を行うVisualforceページ
<apex:page standardController="Account" recordSetVar="accounts">
<apex:form>
<apex:pageBlock >
<apex:pageMessages />
<apex:pageBlockButtons>
<apex:commandButton value="保存" action="{!save}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!accounts}" var="a">
<apex:column headerValue="名前">
<apex:outputLink value="/{!a.Id}"><apex:outputField value="{!a.Name}"/></apex:outputLink>
global class JSRemoteController{
@remoteAction
global static String getEchoService(String areaMessage){
return areaMessage;
}
}
<apex:page controller="JSRemoteController"
docType="html-5.0"
standardStylesheets="false"
applyHtmlTag="false"
applyBodyTag="false"
showHeader="false">
<html>
<head>
<script type="text/javascript">
function getEcho(areaMessage){
/**
* 請求書データを処理する為のユーティリティクラスです。
*/
public class InvoiceUtilities {
/**
* 品目に対して、番号を振り直します。
*
* @return 処理に対する成功、失敗等のメッセージを返却します
*/
public static String renumberLineItems(String invoiceName) {
/**
* 請求書データを処理する為のユーティリティクラスです。
*/
global class InvoiceUtilities {
/**
* 品目に対して、番号を振り直します。
*
* @return 処理に対する成功、失敗等のメッセージを返却します
*/
webservice static String renumberLineItems(String invoiceName) {
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
var result = sforce.apex.execute("InvoiceUtilities","renumberLineItems",{invoiceName:"{!
Invoice__c.Name}"});
alert(result);
window.location.reload();
public class MobileInventoryExtension {
public MobileInventoryExtension(ApexPages.StandardController c) {}
public MobileInventoryExtension(ApexPages.StandardSetController c) {}
@RemoteAction
public static String updateMerchandiseItem(String productId, Integer newInventory) {
List<Merchandise__c> m = [SELECT Id, Name, Price__c, Quantity__c from Merchandise__c WHERE Id =: productId LIMIT 1];
if(m.size() > 0) {
m[0].Quantity__c = newInventory;
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" standardController="Merchandise__c" extensions="MobileInventoryExtension" recordSetVar="products">
<!-- stylesheets and scripts, from CDN (use local files in production) -->
<apex:stylesheet value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js"/>
<apex:includeScript value="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.0/jquery.mobile-1.1.0.min.js"/>
<head>
<title>モバイル在庫管理</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<script>
<apex:page showHeader="false" standardController="Contact" extensions="SendMailFromTemplateController" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false" docType="html-5.0">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script type="text/javascript">
public class SendMailFromTemplateController{
public List<EMailTemplate> templateList{get;set;}
public SendMailFromTemplateController(ApexPages.StandardController standardController){
templateList = [SELECT Name,ID FROM EMailTemplate LIMIT 200];
}
@RemoteAction
public static String getContents(String templateId){