Tuesday, July 2, 2013

Salesforce Fundamentals And Overview


CLOUD COMPUTING :-
              We can access the applications or Apps over the Internet as Utilities rather than as pieces of Software running on your desktop or in the Server Room.

APP & TAB:
             Set of tabs is Called Apps. Tabs Corresponds to a type of Object.
FORMS:
            Form that is displayed a part of tab. Form allow you to view and edit the data associated with a particular record on a tab.

LINKS:
            Links to provide navigation to related data.

THE BENEFITS OF FORCE .COM PLATFORM APP
          i) Data - Centric Apps
          ii) Collaborative

DATA CENTRIC APPS
            A data Centric App is an application that is based on structured consistent information such as you find in a database or XML File.
           That is Structured means - Table Format (not plain text)

COLLABORATIVE APPS
           A Collaborative app is an application with data and services that are shared by multiple users in different locations.

               The platform can be accessed from anywhere in the world with only a web browser.
           * Security and Sharing Model
           * Workflow rules - Assign task, Send Email ....
           * Approval Process - Sequence of Steps

TECHNOLOGIES BEHIND A FORCE.COM PLATFORM APP  

                  i) Multitenant Architecture
                 ii) Metadata - driven development model
                iii) API Access
                iv) Apex
                v) Visualforce
                vi) Salesforce Classsic
                vii) Sites
                viii) App Exchange Directory

A Multitenant Architecture

                In a multitenant architecture, all users share the same infrastructure and the same version of the Force.com platform. In contrast to their single-tenant counterparts, such as client-server enterprise applications or email servers, multitenant architectures release upgrades automatically and simultaneously for all users. Consequently, no one has to worry about buying and maintaining their own physical stack of hardware and software, or making sure that their
applications always have the latest patch installed.

A Metadata-Driven Development Model
                     An App development model that allows to be defined as declarative " blueprints" with no code required. Data Models, Objects, Forms, Workflows and more defined by metadata.

API:
               i) SOAP API
               ii) REST API
Apex
        The world's first on-demand programming language , which runs in cloud on the force.com platform servers.
            It's similar to java. Apex is specifically designed  for building business applications to manage data and processes with in the larger context of the force.com

Visualforce:
               A framework for creating feature rich user interface for apps in the cloud.

Salesforce classic:
              It is used to build the force.com App in IOS, Android and Blackberry devices.

Sites:
             Public websites and apps that are directly integrated with your salesforce organization without requiring users to login with a username and password.

App Exchange:
                Market place for Salesforce Apps.


Friday, June 21, 2013

Analys the webpage response time related problems - Using yslow add-on

YSlow


YSlow analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages.
http://yslow.org is the official open source website.

This add-on requires the following add-ons to work properly:

Wednesday, June 19, 2013

Salesforce Code Scanner - Analyse source code



The Force.com Security Source Scanner is a cloud based source code analysis tool built directly into our Force.com offering. Salesforce.com has made it available to all of its developers, for free, as a high value addition, which will help to enable our community to build trusted applications.

Code is scanned on a first come, first serve basis. Depending on the size and complexity of the code and the queue size, speed of results may vary.

You can run the code scanner through this URL


http://security.force.com/security/tools/forcecom/scanner


In this URL you can submit your dev org username , after submit the URL the code analysis result will send to our mail.



Tuesday, June 18, 2013

JAVASCRIPT - MULTIPLE CHECKBOX SELECTION WITH SHIFT KEY PRESS

MULTIPLE CHECKBOX SELECTION WITH SHIFT KEY PRESS

<script>
function checkboxClick(){
       
$(':checkbox').click(function(e){              
if (e.shiftKey){
   // Entered - When the user clicks the checkbox with shift key
shiftCheckBox = $(this).attr('id');
            // salesforce id's having multiple ':' like 'dbpage:dbform:results:j_id173:5:selectStarredCalls'. So we need to split the unique number of the Id
            // If HTML checkbox you dont need to  split the id
var shiftCheckBoxID = shiftCheckBox.split(':');
var shiftCheckBoxIDPos = shiftCheckBoxID[shiftCheckBoxID.length-2];
shiftCheckBoxIDPos = parseInt(shiftCheckBoxIDPos);                
var checkBoxClickID = checkBoxClick.split(':');
var checkBoxClickIDPos = checkBoxClickID[checkBoxClickID.length-2];
checkBoxClickIDPos = parseInt(checkBoxClickIDPos);
// checkboxIdsList - having id's of all checkboxes, When the checkboxes are created, at the time assign all the checkbox id's in this list
var checkboxIdsArray = checkboxIdsList;

if(shiftCheckBoxIDPos > checkBoxClickIDPos){
for(var i=0; i < checkboxIdsArray.length; i++){                          
var innerId = checkboxIdsArray[i];
var splitedInnerId= innerId.split(':');
var splitedInnerIdPos = splitedInnerId[splitedInnerId.length-2];
splitedInnerIdPos = parseInt(splitedInnerIdPos);
if(splitedInnerIdPos > checkBoxClickIDPos && splitedInnerIdPos < shiftCheckBoxIDPos ){
var inBetweenCheckBoxId = checkboxIdsArray[splitedInnerIdPos];
var test = inBetweenCheckBoxId ;                              
document.getElementById(test).checked = true;
  }
}
}else{
for(var j=0; j < checkboxIdsArray.length; j++){
 
var innerId1 = checkboxIdsArray[j];
var splitedInnerId1= innerId1.split(':');
var splitedInnerIdPos1 = splitedInnerId1[splitedInnerId1.length-2];
splitedInnerIdPos1 = parseInt(splitedInnerIdPos1);
if(splitedInnerIdPos1 > shiftCheckBoxIDPos && splitedInnerIdPos1 < checkBoxClickIDPos ){
var inBetweenCheckBoxId1 = checkboxIdsArray[splitedInnerIdPos1];
var test1 = inBetweenCheckBoxId1 ;
document.getElementById(test1).checked = true;
  }
}
}
}else{
            // Id of last clicked checkbox id (Without shift key press )
checkBoxClick = $(this).attr('id');
}
});
}
</script>

Monday, June 17, 2013

JAVASCRIPT FOR GET THE BROWSER NAME & CLICK EVENT

JAVASCRIPT CODE FOR GET THE BROWSER NAME 

window.onload=function(){
 
var nAgt = navigator.userAgent;
var browserName  = navigator.appName;
var nameOffset,verOffset;

if((verOffset=nAgt.indexOf("Opera"))!=-1) {
browserName = "Opera";
}else if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
browserName = "Microsoft Internet Explorer";
}else if ((verOffset=nAgt.indexOf("Chrome"))!=-1) {
browserName = "Chrome";
}else  if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
browserName = "Safari";
}else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
browserName = "Firefox";
}else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/'))) {
browserName = nAgt.substring(nameOffset,verOffset);
if (browserName.toLowerCase()==browserName.toUpperCase()) {
browserName = navigator.appName;
}
}
document.write('::browserName::'+browserName);
}

CLICK EVENT THROUGH JAVASCRIPT 

// In Safari - (Windows OS) javascript click() function doesn't work. So alternatively we can do the click() function like this

                var evObj = document.createEvent('MouseEvents');
evObj.initMouseEvent('click', true, true, window);
document.getElementById('clickedElementId').dispatchEvent(evObj);
Example:

if(browserName == 'Safari'){
var evObj = document.createEvent('MouseEvents');
evObj.initMouseEvent('click', true, true, window);
document.getElementById('clickedElementId').dispatchEvent(evObj);
}else{
   // This code working in all other browsers
document.getElementById('clickedElementId').click();
}

Javascript Character Codes (Key Codes)

WORKING WITH JAVASCRIPT KEY EVENT

 We can get the keycode in key events like onkeyup, onkeydown, onClick, onKeypress.....

window.onkeyup = function (event) {
if(event.keyCode == 38 || event.which == 38){
// here you can put your up arrow functionality code
}else if(event.keyCode == 40 || event.which == 40){      
// here you can put your down arrow functionality code
}   
if (event.keyCode == 27 || event.which == 27) {
// here you can put your esc key functionality code
like window.close();
}
 
}


KeyCode
backspace8
tab9
enter13
shift16
ctrl17
alt18
pause/break19
caps lock20
escape27
page up33
page down34
end35
home36
left arrow37
up arrow38
right arrow39
down arrow40
insert45
delete46
048
149
250
351
452
553
654
755
856
957
a65
b66
c67
d68
 
KeyCode
e69
f70
g71
h72
i73
j74
k75
l76
m77
n78
o79
p80
q81
r82
s83
t84
u85
v86
w87
x88
y89
z90
left window key91
right window key92
select key93
numpad 096
numpad 197
numpad 298
numpad 399
numpad 4100
numpad 5101
numpad 6102
numpad 7103
 
KeyCode
numpad 8104
numpad 9105
multiply106
add107
subtract109
decimal point110
divide111
f1112
f2113
f3114
f4115
f5116
f6117
f7118
f8119
f9120
f10121
f11122
f12123
num lock144
scroll lock145
semi-colon186
equal sign187
comma188
dash189
period190
forward slash191
grave accent192
open bracket219
back slash220
close braket221
single quote222

Salesforce - Generate dynamic inner query to fetch parent and related child records

Use Case: In many scenarios, we need to clone the records with related child records. Issue / Limitation: We may simply use the "cl...