Chatter Apex Help

http://wiki.developerforce.com/page/Chatter_Code_Recipes

//Adding a Text post
FeedItem post = new FeedItem();
post.ParentId = oId; //eg. Opportunity id, custom object id..
post.Body = ‘Enter post text here’;
insert post;

//Adding a Link post
FeedItem post = new FeedItem();
post.ParentId = oId; //eg. Opportunity id, custom object id..
post.Body = ‘Enter post text here’;
post.LinkUrl = ‘http://www.someurl.com’;
insert post;

//Adding a Content post
FeedItem post = new FeedItem();
post.ParentId = oId; //eg. Opportunity id, custom object id..
post.Body = ‘Enter post text here’;
post.ContentData = base64EncodedFileData;
post.ContentFileName = ‘sample.pdf’;
insert post;

 

kendoui salesforce remoteAction

<apex:page controller=”KendoUIDemoCtrl” sidebar=”false”>
<apex:includeScript value=”{!URLFOR($Resource.queryfiles, ‘js/jquery.min.js’)}”/>
<apex:includeScript value=”{!URLFOR($Resource.KendoLib, ‘js/kendo.web.min.js’)}”/>
<apex:stylesheet value=”{!URLFOR($Resource.KendoLib, ‘styles/kendo.common.min.css’)}”/>
<apex:stylesheet value=”{!URLFOR($Resource.KendoLib, ‘styles/kendo.default.min.css’)}”/>
        <div id=”example”>
            <div id=”grid” style=”height: 380px”></div>
            <script>
$(document).ready(function () {
    var ds = new kendo.data.DataSource({
        transport: {
            read: function (options) {
                // make AJAX request to the remote service
                Visualforce.remoting.Manager.invokeAction(
                    “{!$RemoteAction.KendoUIDemoCtrl.getAccountJson}”,  function (result, event) {
                    if (event.type == ‘exception’) {
                        alert(event.message);
                    } else {
                        options.success(result);
                    } // End else
                });
            }
        },
        schema: {
            model: {
                fields: {
                    Name: { type: “string” },
                    BillingCity: { type: “string” },
                    CreatedDate: { type: “long” }
                }
            }
        },
        group: { field: “Name”, aggregates: [ { field: “Name”, aggregate: “count” }] }
    });
    $(“#grid”).kendoGrid({
        columns: [
            {field: “Name”, groupHeaderTemplate: “Name: #= value # total: #= count #”},
            “BillingCity”, {field:”CreatedDate”,title:”CTDATE”,format: “{0:MM/dd/yyyy}”}],
        //columnMenu: true,
        dataSource: ds,
        groupable: true,
        resizable: true,
        sortable: true,
        scrollable: true,
        filterable: true,
    });
});
            </script>
        </div>
</apex:page>

Apex Send Mail の注意点

例:

Messaging.sendEmail(emails, false);

メール送信すると、送信失敗しました、 エラー:Messaging.SendEmailResult[getErrors=(Messaging.SendEmailError[getTargetObjectId=null;]);isSuccess=false;]

Debugするため、 Messaging.sendEmail(emails, true);
に変更して、 原因は、コードに setTargetObjectId methodを使いましたので
エラーが発生しました
 setTargetObjectIdは Contact/Lead/User だけ使えます、使うと、該当標準メール項目利用して、送信可能

説明:
Required if using a template, optional otherwise. The ID of the contact, lead, or user to which the email will be sent. The ID you specify sets the context and ensures that merge fields in the template contain the correct data