Tuesday 19 August 2014

Sample Package.xml for Migration for ANT in Salesforce Part#2

Hi Folks,
Here I would like to continue with one of my previous blogs. Now I am adding some more useful components to package.xml.
visit first articel : Sample Package.xml for Migration for ANT in Salesforce Part#1

Here is the list:
1. Workflow Email Alert
2. Workflow field Update
3. Workflow Rule
4. Custom Button
5. Report
6. ReportType
7. PageLayout

    
           ObjectAPI.EmailAlertUniqueName
           WorkflowAlert
    
    
    ObjectAPI.fielUpdateUniqueName
           WorkflowFieldUpdate
     
    
           ObjectAPI.workflowruleUniqueName
           WorkflowRule
    
    
           ObjectAPI.customButtonOrLinkName
           WebLink
    
    
           ReportuniqueName
           ReportType
    
    
           ReportFolder/ReportUniqueName
           WebLink
    
    
           ObjectAPI-PageLayoutName
           Layout
    
    26.0

Tuesday 12 August 2014

Dreaming Dreamforce 2014

Hi Folks,

This time I have clubbed my ideas in form of poem. Here it is:

Different minds come on common place
Where your problems will get replaced
with a solution standing in-front of you.
Solutions would surround to you.

Dreamforce forces you to one more Dream
It finds contribution of Dev Cream
It forces you to work hard
To let bring out your idea-train from yard

Dreamforce never sleeps
Elaborate whatever you keep
You will find many new ideas
You would fall in love of its areas.


Lets go to DF#14
Come to DF#14
Welcome to DF#14

Tuesday 10 June 2014

Salesforce Record Accessibility Calculator

Hi Friends, Recently I got a situation where where I had to redirect to a record page where I have not access and got error message like :"Insufficient Privileges You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary." So I have implemented a calculator for record accessibility for any user. You just need to provide record id of S-object and user Id. It will calculate and will show complete access level.
Here Is Code snippet VF Code :

  
  
      
                        
              
                  Please Enter Record ID:    
                  
              
              
                  Please Enter User:    
                  
               
              
                  Note: IF you don't select user then record accesibility will be calculated for logged user 
                           
              
                  
                
          
          
          
          
          
              
                  
                  
                  
                  
                  
              
          
          
      
  

Apex Class Code :
Public Class AccessLevelCalculatorClass{

// Public Variables
Public String recordId{get;set;}
Public User U {get;set;}
Public Contact C {get;set;}
Public List URAs { get;set;}


// Constructor
Public AccessLevelCalculatorClass()
{   
    // Initialization
    U = new User();
    C = new Contact();
    URAs  = new List();
}

// Method to calculate access level
Public PageReference toCalculate()
{
    Try
    {   
        IF(recordId  == null || recordId  == '')
        {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.Error, 'Please Enter Valid Record Id');
            ApexPages.addMessage(myMsg);
            return null;
        } 
        
        URAs  = [Select RecordID, HasreadAccess, HaseditAccess, HasdeleteAccess,HasTransferAccess ,HasAllAccess 
                       From UserRecordAccess where recordID=: recordId And UserId =: UserInfo.getUserId()];
        
        String UserId = C.Related_User__C ;
        If(C.Related_User__C == null)
        {
            UserId = UserInfo.getUserId();
        }
        
        for(User tempUser : [select Name from User Where id = : UserId  ])
        {
            U = tempUser; 
        }
        IF(URAs.size() == 0)
        {
            ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.WARNING, 'Either Record Id is no correct or You do no have any access of this record');
            ApexPages.addMessage(myMsg);
            Return null;
        }
    }   
    Catch(Exception e)
    {
        ApexPages.Addmessages(e);
    }                
    return null;
}

}
Thanks for sharing your time with it.

Saturday 15 March 2014

Sample Package.xml for Migration for ANT in Salesforce Part#1

Hi folks,

Generally we use ANT for migration in salesforce. Here I am providing a sample packag.xml.

    
        SamplClass        
        ApexClass
    
 
        SamplTrigger        
        ApexTrigger
    

 
        SamplComponent        
        ApexComponent
    

    
        SamplePage
        ApexPage
    
 
        SamplePage
        staticResource
    
    
        SampleApplication
        CustomApplication
    
    
        SampleSobject.SampleCustomfield
        CustomField
    
    
        SampleCustomLabel
        CustomLabels
    
    
        SampleSobject        
        CustomObject
    
    
        SampleCustomTab
        CustomTab
    
    
        SampleFolder
        SampleFolder/SampleDocument
        Document
    
    
        SampleFolderName (Unique Name)
        SampleFolderName (Unique Name) /SampleEmailTemplate       
        EmailTemplate
    
    
        SamplePermissionSet        
        PermissionSet
    
    
            Opportunity.ValidationRuleName
            ValidationRule
    
    27.0


it will be updated time to time. Please put your feedback.

Tuesday 25 February 2014

Quick Search Tool for Apex Class/Pages/Component

Hi Developers,

This time I am bringing  a useful tool for Developers. Developer needs a lot to visit Class/Page and Components while working. he needs to navigate

Setup>Develop>Apex Classes/Pages/Components

and then need to search particular component he want to work on.

It takes a lot time specially when list of component is much much long.

I have created a tool where  you just need to selected type of Component you want to search like
Apex Class
Visualforce Page
Visualforce Component


and then type name of that component.

Tool will take you on that particular component. In case component is not available in org then it will redirect you on list of selected type of components.

1. Please get it installed this in your org
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t90000000Mrvo
2. Put Home page component ( part of this package) on your Home Page Component Layout.

I hope you will enjoy it. Any feedback is most invited.