Friday, April 28, 2017

Salesforce Apex Best Practices

Best Practices in Apex Coding

    1.       Avoid DML statement like insert, update and delete inside the looping statement
Example :
List<Account> lstAcc = new List<Account>();
for (i=0; i<=100; i++) {
Account acc = new Account();
Insert acc;
}

    2.       Coding standards should be followed as Apex Developer Guide,
Coding standard helps other people to understand the process. Apex coding standard is similar to java, So developer comes from Java background easy to understand and follow coding standards in Apex
2.1    Class name should start with Capital letter ex : public class Invoice{}
2.2    Variable name should start with small letters ex: String count;
2.3    Method name should start with small letters ex : public void calc() {}
2.4    Provide space in looping statement ex : if () { }, for () { }
2.5    Only method has bracket immediately after the name ex : public void calculator()

    3.       Make sure used Salesforce.com standard functionality wherever possible, instead of customizing the code.

    4.       While production deployment should remove unwanted debug statements, because, more debug statement may slow down the process. For example, if you debug the collections inside the looping statement,  it will print multiple times with huge collection of data
Ex :
Map<Id, List<Account>> mapAcc = new Map<Id, List<Account>>();
for (int i=0; i<=100; i++) {
   System.debug(‘Test’+mapAcc); // should avoid this in production system
}

    5.       Leverage the collections in coding for efficient and optimal coding, Salesforce.com offer following collection statement List, Set, and Maps.

   6.       In complex business logics, should use proper trigger context, it saves lot of saving times, for example before trigger event no need of additional DML statements. After update use old (Trigger.OLD) values instead of additional query wherever possible.

   7.       It is better practice to use comments /* */, it provide explanation of the method, however, comment should be updated properly if any changes in the corresponding methods or classes. Otherwise it leads to lot of confusions for future changes.

   8.       As a apex developer should familiarize with order of execution, I have seen people overlooked on Validation rule executed before the all after triggers. So need to understand the flow correctly in the way to detect the problems.

   9.       In all DML statement should be inside try and catch statement, as well exception should be handled efficient way.
Try {
insert acclist;
} catch (Exception e) {
   // handle the exception
}

   10.    Variable name of collections should reflect accordingly, for example if it is Map<ID,String> then variable name should reflect as mapInventory or inventoryMap;

Sunday, April 6, 2014

CRM - Customer Relationship Management


   We divided CRM into following ways or categories. Each customer need different type of business approach. For example, Brokerage company only Advertisement purpose, some company needs campaign purpose it depends on their needs to opt cloud computing services.

 Major categories are

  1. Marketing  
  2. Sales  
  3. Support 

 Marketing Cloud

  In marketing , have to chose based on products needs to market  for example if they want sell consumer goods then following way to marketing,

  1. Free product samples for respective professionals
  2. TV Advertisement
  3. Road shows 
  4. Posters 
  5. Sales promotion

  Now, you got some idea about marketing ways, you have to keep all marketing customers data, In CRM software technical word called " Leads ". After that we have to call interested customers to convert into accounts or contacts of our products. 

  In mot business industries, the followed Salesforce automation process (SFA). In order to understand CRM products have to know SFA process. 

  Step 1 : Campaigns
  Step 2 : Campaigns Customer convert into Leads
  Step 3 : Who are all interested convert Leads into Account
  Step 4 : Each accounts create opportunity based on their products 
  Step 5 : Once you win the product opportunity based on condition create warranty and
                Service agreement.  

    In technical term, we call it us "Marketing cloud" 

 Sales cloud

      All the opportunity, either won the opportunity or not for the particular products, based on probability of wining opport.., we calculate effectiveness of campaigns.  

     In technical term, we call it us "Sales cloud" 

Service Cloud

    Once customer bought our products, we have to give warranty and support to products. We achieve this via Cases, we collecting complaints via various ways now a day’s most of the company collecting via Social sites like Facebook, twitter, and so on.    

   For premier customer have special case like have to support or solve their issues with in particular time periods or days. 

   In technical term, we call it us “Service cloud"
  

Saturday, April 5, 2014

What is CRM, HCM , ERP , SAP ?

  Hi all,
    The  three letter words made us confuse and difficult to understand,  Really it confusing !

CRM (Customer Relationship Management) 

    In the competitive world everybody have to keep their business contacts from small shoe seller to Big Jet Seller. Have to follow their needs and getting feedback of your products as well support to your customer as per their needs.

   How are you going to achieve or handle Marketing struggles, that is where the word "CRM" comes into the picture, Software As a Service clouds sites are providing software for customer relationship.

In CRM, there are three major parts.

   1. Market the Product (Marketing)
   2. Sell your Products (Selling)
   3. Support to the Products (Support)

  We will see individually in future posting.

  The cloud competitors for CRM's are Salesforce.com, windows Azure, sugar CRM, Oracle cloud and so on . 

 HCM (Human capital Management) 

    The word implies the meaning of the functionality , Imagine  if you have 100 employees how are you going to manage their records, records like everything employee personal information, educational information, experience , previous pay structure , their respective reporting manager, it's not easy task, even you couldn't imagine without computers.

   Think about lakh of employees across the globe, so the software HCM comes into the picture in this way. The company like oracle their products call People Soft (Initially it is different company, oracle acquire it) to provide HCM software.   

ERP (Enterprise Resource Planning) 

    The collection of HCM, CRM and some more tools, A Big software is called ERP normally ERP products are very costly, customer have to obtain depends on their needs, ERP have everything for your business. The company like ORACLE, SAP , RAMCO , TALLY SOLUTIONS and many more companies involved in ERP software manufacturing. 

  As we discussed already, ERP is a Integral part of all the software package like for marketing, shipping, project management, cost analysis, people soft and so on. 

 The cloud ERP companies are SAP ERP, Oracle ERP , HP and so on 

 SAP    

  The SAP is a German based company; they are developing softwares to the entire domain, that's what it's very famous across the globe. SAP had around 11 modules to achieve lot of business functionality. Like they are developing SAP ERP apart from lot of cost estimation and analysis tools for various industries like auto-mobiles, Goods Handler, Shipping, E-Commerce and So on.

  Compare to Oracle products SAP provide lot of additional module and business scenario almost meet all the industry.



Friday, April 4, 2014

What cloud Does ?

       In Last post , we discussed about what is cloud ? This post discussed about how it differ from On-premise.

     As we know, All IT companies are going for cost cutting, but they won't compromise security and availability of resource for their customers. In this situation cloud service companies started around 2010.

    They are offering all the services with Use and pay methods like how much time you are using just pay only for particular time.




What cloud does?
 
     Very good question, what it does, simply it working as on-premise server only  except all the services provided via internet, Services means request, response especially User Interface . So, the cloud data and cloud resource have to store somewhere in the on-premise only.
    
     Companies have to focus only on their customer business functionality and will get what they want, they no need worry about hardware, softwares, servers, Data storage process especially security mechanism like anti-virus, firewalls and so on.

    The following are cloud categories with service offered company.

  Software As a Service (SaaS)

     - Salesforce.com, Sugar CRM , Zscalar (Security) Products , Eloqua , SAP  and so on.

 Platform As a Service (PaaS)

    - Salesforce Force.com, Google App Engine, Windows Azure, Amazon Web Service , RightScale  and so on.

Infrastructure As  a Service (IaaS)

  - Amazon (Famous one ), CA Technology , Hp  , GoGrid and So On.

Apart from in emerging Cloud services like Data As a Service, Security As a Service and So on.

One thing we need to remember the Word “On- Demand “which means whenever you need. For example some software or business is for only short term like marketing some products only on summer.

Thursday, April 3, 2014

What is Cloud ?

                Now a days the word "Cloud" very popular around IT Industry. Every body suddenly talking and discussing about Cloud computing.. Students are asking which Cloud Computer Course good to get easy job. so what is the Buzz ? with the world "Cloud computing".

            As I remember I studied on of the subject in my Bachelor Degree. But, the point is I don't have any idea about that subject now. Anyway Here, this blog going to discuss about the cloud computing and it's service. 





First of all, few points needs to discuss before cloud computing. 

   What ever data and business functionality earlier we developed in programming language like c,c++ and java . We stored data in servers like Oracle,Access,MySql and MSSql so on.
 In IT technical term it is call "on-Premise" , so everything as Asset separate computer,Hardware and Servers Apart from Operating System , Business software and Importantly Anti-wires.

 In IT Revaluation all company learn about Cost Cuttings, Importantly how to minimize the cost with maximum Utilization As the result booming for Cloud Computing.

    Companies are moving On-Permise to Cloud. What they are moving to Cloud as we discussed earlier everything they moved to cloud like Data, anti-wires even operating system and so on. In Cloud computing world they call it as "Service" actually they are charging.

 The cloud computing companies divided services into multiple ways. They are
 1. Software As a Service (SaaS) 
2. Platform As a Service (PaaS) 
 3. Infrastructure As a Service (IaaS) and
 Lot of different services like Business as a Service and so on.