3. Safe Harbor
Safe harbor statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or
implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking,
including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements
regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded
services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality
for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results
and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated
with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history,
our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer
deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further
information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for
the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing
important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available
and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions
based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-
looking statements.
10. Apex Form
Required for standard salesforce post
Incurs Viewstate Overhead
<apex:form>
…
</apex:form
aspdoifuapknva894372h
4ofincao98vh0q938hfoq
iwnbdco8q73h0o9fqubov
ilbodfubqo3e8ufbw
11. Interacting with the Platform
Apex Controller Instance Method
Apex Controller Static Remoting Method
REST API
Visualforce Remote Object
12. Apex Instance Method
Use with apex:actionFunction to access via
Javascript
ActionFunction requires ViewState
Reduce ViewState with Transient and Static
13. Apex Remote Action
Static
No View State
Invoked through JS API
Invokes JS Callback
@remoteAction
global static String myMethod(String
inputParam){
...
}
14. Calling Apex Remote Action
Visualforce.remoting.Manager.invokeAction(’
{!$RemoteAction.RemoteClass.methodName}'
,
param,
function(result, event) {
//...callback to handle result
});
16. Event Object: Failure Example
{
"statusCode":400,
"type":"exception",
"action":"IncidentReport",
"method":"createIncidentReport",
"message":"List has more than 1 row for assignment to SObject",
"data": {"0":
{"Merchandise__c":"a052000000GUgYgAAL","Type__c":"Accident","Desc
ription__c":"This is an accident report"}},
"result":null,
"status":false
}
17. Interacting with the Publisher: Allow Submit
Make Submit Active
Payload true/false
Sfdc.canvas.publisher.publish(
{
name:
"publisher.setValidForSubmit", payload:true
});
18. Interacting with the Publisher: Subscribe to Submit
Attach to Submit Event
Sfdc.canvas.publisher.subscribe({
name: "publisher.post",
onData:function(e) {
// This subscribe fires when the user hits 'Submit'
in the publisher
postToFeed();
}});
19. Interacting with the Publisher: Close Publisher
Make the Submit Happen
Sfdc.canvas.publisher.publish({name:
"publisher.close", payload:
{ refresh:"true"}});
20. REST API
For large data transactions
Use forcetk library for easy access.
github.com/developerforce/Force.com-JavaScript-REST-
Toolkit
21. forcetk: Init and Bind To Session
<apex:includeScript value="{!$Resource.forcetk}"/>
...
var restClient = new forcetk.Client();
var contentId;
var merchId;
restClient.setSessionToken('{!$Api.Session_ID}');
//turn off proxy now that we have session
restClient.proxyUrl = null;
restClient.instanceUrl = '';
24. Remote Objects
Standard CRUD/Q functionality without Apex
Similar to remoteTK or SObjectData
Visualforce components define data models
<apex:jsSObjectBase shortcut="tickets">
<apex:jsSObjectModel name="Ticket__c" />
<apex:jsSObjectModel name="Contact" fields="Email" />
<script>
var contact = new tickets.Contact();
contact.retrieve({
where: {
Email: {
like: query + '%'
}
}
}, function(err, data) {
Notas do Editor
Everything we show today will be current product, but this is a reminder to please make your purchasing decisions based on the product we have today, not on any forward-looking statements we may make.
For when declarative logic is not enough, we provide Apex. Apex is a cloud-based programming language, very similar to Java – except that you can code, compile and deploy all right from your Salesforce instance. You’ll see how we can create robust programmatic functions right from your browser.
Result is the return from the invoked method.Event is an object that represents data returned from the callback to communicate the state of the call (success, failure, HTTP code, This could do with examples on what to do with the result.
This is an excerpt showing some of the important attributes. The full JSON response taken from this example is below:{"statusCode":400,"type":"exception","tid":2,"ref":false,"action":"IncidentReport","method":"createIncidentReport","message":"List has more than 1 row for assignment to SObject","where":"","data":{"0":{"Merchandise__c":"a052000000GUgYgAAL","Type__c":"Accident","Description__c":"asdfasdf"}},"vfTx":true,"vfDbg":true,"result":null,"status":false}