How to enable quotes in Salesforce?


Hard Delete

Using Hard Delete operation, we can delete existing records from our Salesforce organization permanently. Deleted records will not be available in Recycle Bin. “Bulk API Hard Delete” check box should be enabled in user profile for permanently deleting the records.


Cheers!!!

Upsert operation in Salesforce

Upsert opeation makes use of the sObject record's primary key(Salesforce.com Record Id) or the external ID, if specified to determine whether new records should be created or else we have to update the existing records.
  • If the key is not matched, then a new record is created.
  • If the key is matched once, then the existing record is updated.
  • If the key is matched multiple times, then an error is generated and the object record is neither inserted nor updated.
Cheers!!!

How to remove space from a string in Salesforce?

deleteWhitespace() is used to remove spaces in a string in Salesforce.

Sample Code:

String str = 'Hello Hi';
system.debug(str.deleteWhitespace()); //HelloHi

SOQL

SOQL(Salesforce Object Query Language) is used to build a query to fetch data. As we write a query in SQL(Structure Query Language) with the columns and a table, here in SOQL we write the queries with the fields and an Object.

Check the below link for sample SOQLs

http://www.infallibletechie.com/search/label/SOQL

Cheers!!!

Detail page of Case in Salesforce


Getting Null values from Custom Settings in Test class in Salesforce

Create records for Custom Setting to avoid null values from Custom Settings in Test class in Salesforce.

Syntax:

@isTest
public class testClass {
@TestSetup static void setupData() {
SampleCustomSettings__c obj = new SampleCustomSettings__c(Name = 'Testing');
insert obj;
}
static testMethod void test() {
Test.StartTest();
/*..............
..............*/
Test.stopTest();        
}
}

Cheers!!!

CTS Opening


Developer (Job Number: 00009523011)

India-West Bengal-Kolkata

Description

Key Responsibilities
 Involved in coding, testing, debugging. Responsible for delivery of assigned work, under a module lead or team lead supervision. Needs to understand technology and quality processes within Cognizant.
Qualifications
 Bachelor’s degree in Engineering or Science graduates with 0-4 years of experience.

Link to Apply:


Radar Chart using Visualforce and Apex in Salesforce

Sample Code:

Visualforce page:

<apex:page sidebar="false" Controller="Sample" showHeader="true" id="pg">
<apex:chart height="750" width="800" legend="true" data="{!data}">
    <apex:legend position="left"/>
    <apex:axis type="Radial" position="radial">
        <apex:chartLabel />
    </apex:axis>
    <apex:radarSeries xField="memName" yField="tenthPercent" tips="true" opacity="0.4"/>
    <apex:radarSeries xField="memName" yField="twelthPercent" tips="true" opacity="0.4"/>
    <apex:radarSeries xField="memName" yField="age" tips="true" markerType="cross" strokeWidth="2" strokeColor="#f33" opacity="0.4"/>
</apex:chart>
</apex:page>

Apex Controller:

public class Sample {   

    public List<RadarData> data {get;set;}
    public sample() {
    data = new List<RadarData>();
        List<Member__c> memList = new List<Member__c>();
        memList = [SELECT Name, Age__c, X10th__c, X12th__c FROM Member__c];
        for(Member__c mem : memList) {
            data.add(new RadarData(mem.Name, mem.X10th__c, mem.X12th__c, mem.Age__c));
        }
    }
    public class RadarData {
        String memName {get;set;}
        Decimal tenthPercent {get;set;}
        Decimal twelthPercent {get;set;}
        Decimal age {get;set;}
        
        public RadarData(String memName, Decimal tenthPercent, Decimal twelthPercent, Decimal age) {
            this.memName = memName;
            this.tenthPercent = tenthPercent;
            this.twelthPercent = twelthPercent;
            this.Age = age;
        }
    }
}

Output:


How to disable and enable button in Visualforce page in Salesforce?

Sample Code:

Visualforce page:

<apex:page sidebar="false" Controller="Sample" showHeader="true" id="pg">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> 
    <script>
        var $ = jQuery.noConflict();
        function btnClick() {           
            $('input[id*=confirmBtn]').attr('value','Saving...');
            $('input[id*=confirmBtn]').attr('class', 'btnDisabled');
            callShow();
        }
        
        function btnComplete(){
            $('input[id*=confirmBtn]').attr('value','Saved');
            $('input[id*=confirmBtn]').attr('class', 'btn');
            return true;
        }
    </script>
    <apex:form id="frm">
        <apex:actionFunction name="callShow" action="{!show}"/>        
        <apex:outputText value="{!temp}"/>
        <br/>
        <apex:commandButton id="confirmBtn" value="Save" onclick="btnClick();" oncomplete="btnComplete();" reRender="frm"/>
    </apex:form>
</apex:page>

Apex controller:

public class Sample {   
    public String temp {get;set;}
    public sample() {
    }
    public pagereference show() {
        temp = 'Testing';
        return null;
    }
}

Output:


Before clicking the Button:


While Button processing:


After clicking the Button:


Trigger to sum all the child record field and storing it in another object field in Salesforce


Consider the below Scenario
Quote and Structure__c --> Master Detail relationship
Quote and Bigmachine__c --> Lookup relationship
Structure__c and Bigmachine__c --> Lookup relationship

We have to calculate total scope on Big Machine object, which should be the sum of all scope in Structure__c object.


Sample Trigger:

trigger Structure_AIUD on Structure__c (after insert, after update) {
    Set<Id> quoteIds = new Set<Id>();
    List<Structure__c> structList = new List<Structure__c>();
    Map<Id, List<Structure__c>> quoteIdStructListMap = new Map<Id, List<Structure__c>>();
    List<Big_Machine__c> bigMachineList = new List<Big_Machine__c>();
    Map<Id, Double> quoteIdTotalScopeMap = new Map<Id, Double>();
    
    for(Structure__c struct : trigger.New) {
        quoteIds.add(struct.Quote__c);
    }
    
    structList = [SELECT Id, Scope__c, Quote__c FROM Structure__c WHERE Quote__C IN : quoteIds];
    bigMachineList = [SELECT Id, Total_Scope__c, Quote__c FROM Big_Machine__c WHERE Quote__C IN : quoteIds];
    
    if(bigMachineList.size() > 0) {
        if(structList.size() > 0) {
            for(Structure__c struct : structList) {
                if(!quoteIdStructListMap.containsKey(struct.Quote__c)) {
                    quoteIdStructListMap.put(struct.Quote__c, new List<Structure__c>());
                }
                quoteIdStructListMap.get(struct.Quote__c).add(struct);
            }    
            
            for(Id quoteId : quoteIdStructListMap.keySet()) {
                List<Structure__c> tempStructList = new List<Structure__c>();
                tempStructList = quoteIdStructListMap.get(quoteId);
                Double tempTotalScope = 0;
                for(Structure__c struct : tempStructList) {
                    tempTotalScope = tempTotalScope + struct.Scope__c;
                }
                quoteIdTotalScopeMap.put(quoteId, tempTotalScope);
            }           
        }
        for(Big_Machine__c bigMachine : bigMachineList) {
            bigMachine.Total_Scope__c = quoteIdTotalScopeMap.get(bigMachine.Quote__c);
        }
        update bigMachineList;
    }
}

Coding standards in Salesforce

Visualforce page Name:

Example:

InventoryStatusPage

------------------------------------------------------------------------------------------------------------

Controller Name:

Example:

InventoryStatusController

------------------------------------------------------------------------------------------------------------


Extension Name:

Example:

InventoryStatusExt

------------------------------------------------------------------------------------------------------------


Test Class Name:

Example:

InventoryStatusTest

------------------------------------------------------------------------------------------------------------


Batch Class Name:

Example:

InventoryStatusBatch

------------------------------------------------------------------------------------------------------------


Scheduler Class Name:

Example:

InventoryStatusScheduler

------------------------------------------------------------------------------------------------------------

1. Never use SOQL and DML inside for loop.

2. Never hard code values inside the apex classes. Make use of Custom Label or Custom Component.

Test Class for Standard Controller in Salesforce

Sample Code:

Account a = new Account(Name = 'Test');
Class_Name obj = new Class_Name(new ApexPages.StandardController(a));

here the controller is referred to a page where the standard controller is Account.

Cheers!!!

TCS Off Campus for 2012 and 2013 passedouts

Company: TCS
Salary Offered: Best in the Industry
Job Role: Software Engineer
Qualification: B.E/B.Tech, MCA, MS, MTECH
Experience: Fresher

Register using the below link for upcoming off campus:

https://nextstep.tcs.com/campus/

CreatedBy and CreatedDate in SOQL

Sample SOQL:

SELECT Id, CreatedById, CreatedDate FROM Account

QlikView free tutorial

Check the below link for QlikView free tutorial

http://www.qlikview.com/us/services/training/free-training

Cheers!!!

CurrentStatus in user object in Salesforce

CurrentStatus is similar to posting your current status in Facebook. If we create a Post in Facebook, it will be available in your posts. Similarly whenever this current status is updated, a new Post will be posted in your chatter.

If you update this field, the API automatically adds a post of type UserStatus on the user’s profile in Chatter.

This field is deprecated in API version 25.0. To achieve similar behavior, post to the user directly by creating a FeedItem with the user’s ParentId.


Cheers!

QlikView

QlikView is the most flexible Business Intelligence platform for turning data into knowledge. More than 24,000 organisations worldwide have enabled their users to easily consolidate, search, and visually analyse all their data for unprecedented business insight using QlikView’s simplicity.

 Effective decision-making is based on having the right information available and easy accessible.
Taking just minutes to learn, the automatic associations of QlikView create endless possibilities for making ad hoc queries without requiring tediously defined structures and hierarchies, as is typical in other data analysis tools. QlikView promotes unrestricted analysis of application data, helping users make time-saving and accurate decisions.

It brings a whole new level of analysis, insight, and value to existing data stores with user interfaces that are clean, simple, and straightforward.

Opening for Freshers 2011|2012|2013|2014

Name Of The Company: Capgemini
Experience Required: Freshers
Educational Qualification: Any Graduate/PG
Job Designation: Entry Level Engineer
Functional Area: Application Programming
Type of Industry: IT-Software Services
Package Offered : Best in Market
Work Location: Across India
About company: 
Capgemini is one of the world’s foremost providers of consulting, technology and outsourcing services. Present in 40 countries with more than 120,000 employees, the Capgemini Group helps its clients transform in order to improve their performance and competitive positioning.We offer an array of integrated services that combine top-of-the-range technology with deep sector expertise and a strong command of our four key businesses.
Cheers!!!

Parent relationship queries are disabled in Workbench

1. Go to the Workbench setting.


2. In Query & Search option, check "Allows SOQL Parent Relationship Queries" check box and click on apply setting.


You will be able to access the parent relationship queries.

Workday.com Community

Check the below link for Workday.com Community

https://community.workday.com/

Cheers!

workday.com

Workday.com is an on‑demand (cloud-based) human capital management and financial management software vendor. It was founded by David Duffield, the founder and former CEO of the ERP giant PeopleSoft, and former PeopleSoft chief strategist Aneel Bhusri following Oracle's hostile takeover of PeopleSoft in 2005. It targets the customers of rivals Oracle or SAP by offering them "online services at a fraction of the cost of upgrading from their incumbent vendors".

Workday is the leader in SaaS-based enterprise solutions for human resources, payroll and financial management, providing new levels of business agility for a fraction of the cost of buying, deploying and maintaining legacy on-premise systems.

Workday Human Capital Management and Workday Financial Management use modern, standards-based technologies to provide an unparalleled level of agility, ease-of-use, and integration capability.

For more information about Workday, kindly visit www.workday.com.

Cheers!!!

Test class for Schedulable class in Salesforce

Sample :

@istest
public with sharing class SampleTest {
    static testmethod void testSample() {
        Test.startTest();
        Schedulable_Class  obj = new Schedulable_Class();
        obj.execute(null);
        Test.stopTest();
    }

}

Cheers!!!

Code Coverage in Salesforce Testing

1. Go to Developer Console.

2. Go to Test --> New Run.


3. Select the Test class and click "Run" button to run the test.

Cheers!!!