Posts

Showing posts from August, 2016

Apex Classes as REST Web Services in Salesforce

Introduction to Apex REST Salesforce platform is amazing and its lets your create your own lightweight  REST API using Apex. You can use this REST API to access force.com data, by authenticating the caller/consumer of API using standard oAuth and return data format support JSON/XML, purely depends how you want return back the data A few useful bits of information related to these REST APIs: Use standard HTTP verbs: GET, POST, PUT, PATCH, DELETE, and HEAD. You can use either HTTP or HTTPS. Use standard security to authenticate your REST calls via OAuth 2.0. Serialize your data in either XML or JSON format. This is done by defining your Apex class with the  @RestResource  annotation to expose it as a REST resource. Similarly, add annotations to your methods to expose them through REST. For example, you can add the @HttpGet  annotation to your method to expose it as a REST resource that can be called by an HTTP  GET  request.  Apex REST Annotations Six new ann

All about Service Oriented Architecture : SOAP / REST differences and usage

Image
Service Oriented Architecture  with  REST/SOAP in SFDC A service-oriented architecture is essentially a collection of services. These services communicate with each other. The communication can involve either simple data passing or it could involve two or more services coordinating some activity. Some means of connecting services to each other is needed. The technology of Web Services is the most likely connection technology of service-oriented architectures. The following figure illustrates a basic service-oriented architecture. It shows a service consumer at the right sending a service request message to a service provider at the left. The service provider returns a response message to the service consumer.  The request and subsequent response connections are defined in some way that is understandable to both the service consumer and service provider. How those connections are defined is explained in Web Services Explained. A service provider can also be a service con

All about workflow rule , limitation and important points with example

Image
Workflow Rule  Workflow is a force platform business logic engine that allows us to automatically send email alerts, assign tasks, field updates based on rules that we define. – Defined trigger criteria based on your business requirements – Evaluated when record is created, when created/updated, OR when created/updated and did not previously meet trigger criteria – When trigger criteria is met workflow actions, such as email alerts, tasks, field updates, or outbound messages are generated To get started using workflow rules, click • Setup | Create| Workflow & Approvals | Workflow Rules Workflow action in Salesforce : Task Alert Email Field Update Outbound message #1 Workflow Task: Assign task to a user #2 Email Alert Used to generate email from the workflow #3 Field Update  https://help.salesforce.com/apex/HTViewHelpDoc?id=workflow_field_update_considerations.htm&language=en #4 Outbound Messages:  Send a configurab

Custom Setting in Salesforce

Image
                              Custom settings Custom settings are similar to custom objects in that they let you customize org data. Unlike custom objects which have records based on them, custom settings let you utilize custom data sets across your org, or distinguish particular users or profiles based on custom criteria. Before we start the example its just worth to mention that there are two types of custom settings List and Hierarchical. As of now lets discuss List type.   Say for ex. we have to store data of states and its capital cities. So a state should have its capital associated with it. For this we can create a custom setting and store data in two fields. Custom setting default gives one field "Name" so this is our name of the state. So we need one more field to store the capital of the state "Capital". After our fields are created its time to create the data (States and its capitals) We can create this by pressing "Manage" and