Setting Sobject ID For Update

Spring ’13 Force.com Platform Release Setting ID Fields for Updates Starting with Apex code saved using Salesforce.com API version 27.0, the Id field is now writeable on sObject instances for all sObject types—standard objects, custom objects, and generic sObjects—for update operations. The insert operation doesn’t support setting Id fields on sObjects. This change enables you to update existing records that correspond to sObject instances you already have, such as sObjects you obtained from deserializing JSON input. To do so, set the Id field on the sObjects to IDs of existing records in the database and call update. This call updates the corresponding records with all the other fields that are set on the sObjects.

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>