New Batch#100 (10th Nov 2021) - Salesforce Admin + Dev Training (WhatsApp: +91 - 8087988044) :https://t.co/p4F3oeQagK

Sunday 30 September 2012

custom login page

Refer:
http://boards.developerforce.com/t5/Visualforce-Development/custom-login-page/m-p/501739

Saturday 29 September 2012

Div and Span html tags difference

Div: We can define a section and apply CSS Styles.
Span: We can define an element or area of a section and we can apply CSS Styles.
Refer:
http://www.slideshare.net/biswadip/span-and-div-tags-in-html
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_span

Friday 28 September 2012

CSS for changing the color of a hyper link


<apex:page sidebar="false" standardController="Sample__c">
    <head>
    <style type="text/css">
    a:link {
    COLOR: #FF0000;
    }
    a:visited {
    COLOR: #008000;
    }
    a:hover {
    COLOR: #FF0000;
    }
    a:active {
    COLOR: #00FF00;
    }
</style> 
    </head>
    <apex:form >
        <!-- Designing Sidebar -->
        <table>
         <tr>
          <th width="200" valign="top">
        <apex:outputPanel >
            <apex:pageblock title="Sidebar">
                <apex:pageblockSection columns="1">
                    <apex:commandlink value="One"/>
                    <apex:commandlink value="Two"/>
                </apex:pageblockSection>
            </apex:pageblock>
        </apex:outputPanel>
        <!-- All pages comes here -->
         </th>
         <th>
        <apex:outputPanel >
            <apex:pageblock title="One">    
                <apex:pageblockSection >
                    <apex:inputField value="{!Sample__c.name}"/>
                    <apex:inputField value="{!Sample__c.City__c}"/> 
                </apex:pageblockSection>
            </apex:pageblock>
            <apex:pageblock title="Two"> 
                <apex:pageblockSection >
                    <apex:inputField value="{!Sample__c.Mobile__c}"/>
                    <apex:inputField value="{!Sample__c.Salary__c}"/> 
                </apex:pageblockSection>
            </apex:pageblock>
        </apex:outputPanel>
          </th>
         </tr>
        </table> 
    </apex:form>
</apex:page>

<apex:page sidebar="false" standardController="Sample__c" Extensions="sample">
<body text="#507070" link="#900000" alink="#D06000" vlink="#C08000" bgcolor="#FFD078">
    <apex:form >
        <!-- Designing Sidebar -->
        <table>
         <tr>
          <th width="200" valign="top">
        <apex:outputPanel >
            <apex:pageblock id="Sidebar">
                <apex:pageblockSection columns="1" title="Sidebar" collapsible="false">
                    <apex:commandlink value="One" action="{!pageOne}" style="color: #CC0000"/>
                    <apex:commandlink value="Two" action="{!pageTwo}"/>
                </apex:pageblockSection>
            </apex:pageblock>
        </apex:outputPanel>
        <!-- All pages comes here -->
         </th>
         <th>
        <apex:outputPanel >
            <apex:pageblock title="One" rendered="{!page1}">    
                <apex:pageblockSection >
                    <apex:inputField value="{!Sample__c.name}"/>
                    <apex:inputField value="{!Sample__c.City__c}"/> 
                </apex:pageblockSection>
            </apex:pageblock>
            <apex:pageblock title="Two" rendered="{!page2}"> 
                <apex:pageblockSection >
                    <apex:inputField value="{!Sample__c.Mobile__c}"/>
                    <apex:inputField value="{!Sample__c.Salary__c}"/> 
                </apex:pageblockSection>
            </apex:pageblock>
        </apex:outputPanel>
          </th>
         </tr>
        </table> 
    </apex:form>
    </body>
</apex:page>

Refer:
http://www.goldcoastwebdesigns.com/change-hyperlink-color.shtml

Tuesday 25 September 2012

Data Loader CLI

Data Loader CLI (Command Line Interpreter):
* For automating the batches and schedule them using windows "Task Scheduler".
* We can perform import as well as export.
Windows-7 Task Scheduler
* We can do all the same things from the command line - insert data, update data, upsert data, delete data or extract data.
* Instead of "export", we should use "extract".
* We can move data to and from a comma-separated variable file (.csv) or to and from a relational database, such as Oracle or SQL Server, that has a standard JDBC driver.
* With a default installation on a Windows machine, all the Data Loader files will be placed in the Program Files\salesforce.com\Apex Data Loader APIversion directory, where APIversion corresponds to the API version.
* The process command, encrypt command will be in the bin subdirectory, and the configuration files will normally be in the conf subdirectory.
*The main configuration file used by the CLI is the process-conf.xml file.
* The process-conf.xml file contains a description for every potential process that could be called from the command line.
* Each of these processes is referred to as a Process Bean. 
* In this simple example, there is only one Process Bean in the process-conf.xml file.
* In normal practice, though, you would have a number of Process Bean sections in the configuration file, so calling out the specific process would make sense.
* The process-conf.xml file consists of a set of property-value pairs.
* The file used for this sample process is shown below, with an explanation of the key entries following the listing.
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="csvInsertArtist"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
        <description>Inserts artist names from CSV file into Artist custom object.</description>
        <property name="name" value="csvInsertArtist"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.debugMessagesFile" value="c:\dataloader\csvInsertArtist.log"/>
                <entry key="sfdc.endpoint" value="https://www.salesforce.com"/>
                <entry key="sfdc.username" value="<i>Your Salesforce ID</i>"/>
                <entry key="sfdc.password" value="<i>Your encrypted Salesforce password</>"/>
                <entry key="sfdc.timeoutSecs" value="540"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Artist__c"/>
                <entry key="process.operation" value="insert"/>
                <entry key="process.mappingFile" value="c:\dataloader\artistmap.sdl"/>
                <entry key="process.outputError" value="c:\dataloader\errorInsertArtist.csv"/>
                <entry key="process.outputSuccess" value="c:\dataloader\successInsertArtist.csv"/>
                <entry key="dataAccess.name" value="c:\dataloader\Artists_1_100.csv" /> 
                <entry key="dataAccess.type" value="csvRead" /> 
                <entry key="process.initialLastRunDate" value="2007-06-06T00:00:00.000-0800"/>
            </map>
        </property>
   </bean>
</beans>
 Configuration properties:
The process-conf.xml file contains properties for one or more Process Beans. Some of the more important properties are
  • name - used to identify the bean in the config.properties file and when you call it from the CLI
  • sfdc.entity - the Salesforce object that is the target of the actions. The value of this property is case sensitive.
  • process.operation - identifies the type of operation
  • process.mappingFile - identifies the mapping between the fields in the source file (dataAccess.name) and the Salesforce object. This mapping file is a .sdl file. The mapping file is the same format as the .sdl file created by the GUI when you save a mapping scheme.
  • dataAccess.type - identifies the operation to perform on the source file
  • sfdc.username - your Salesforce.com user name 
* To schedule the file we should open windows Task Scheduler.
C:\Program Files (x86)
C:\Program Files (x86)\salesforce.com\Data Loader\bin
process ../conf csvInsertArtist

* C:\Program Files (x86)
C:\Program Files (x86)\salesforce.com\Data Loader\bin
process ../conf csvInsertArtist
-- Save it as filename.bat--
Refer:
Data Loader CLI

Report should be available only to CEO, for others it should be hide, how can we do it?

For a specific Report:
* Specific Report can be controlled by creating a custom report folder and assigning just the CEO as a viewer of this folder. All reports in the folder will be visible to the CEO only in that scenario.
* Observe below screen shots:


 For the Reports Tab:
* Reports Tab can be controlled by the User Profile

Sunday 23 September 2012

Adding a custom button to page layout

* Go to Object detail page> Go to Custom buttons and links section > create a custom button
* After creating custom button Go to page layout of the object> there you can find buttons and links option> click on that and drag to custom buttons and links area

Friday 21 September 2012

Is it possible to refer static resources files in formula fields

Unfortunately, it does not. The reason is that static resources cannot be referenced in formula fields.

But no big deal, because each static resource gets its own unique URL. So you could go to your static resource and click ‘Click here to view this file’ 
 
Refer:
http://improveit360.blogspot.in/2010/09/how-to-use-static-resource-images-in.html

Wednesday 12 September 2012

Annotations

Annotations:
* An Apex annotation modifies the way a method or class is used, similar to annotations in Java.
* Annotations are defined with an initial @ symbol, followed by the appropriate keyword.
* To add an annotation to a method, specify it immediately before the method or class definition.
global class MyClass {
     @future
     Public static void myMethod(String a)
     {
          //long-running Apex code    
     }
}
Annotations supported by Apex
Annotation Name
Description
@Deprecated
* Use the deprecated annotation to identify methods, classes, exceptions, enums, interfaces or variables that can no longer be referenced in subsequent release of the managed package in which they reside.
* This is useful when you are refactoring code in managed package as the requirements evolve.
* New subscribers cannot see the deprecated elements, while the elements continue to function for existing subscribers and API integrations.
Syntax:
@deprecated
//This method is deprecated, use myOptimizedMethod(String a, String b) instead
Public void myMethod(String a) {
}

@Future

@IsTest

@ReadOnly

@RemoteAction


Latest Versions in SFDC



Name
Latest Version
Apex Data loader
29.0
Force.com API
29.0
Force.com IDE
29.0.0 (compatible with Eclipse 4.2 and 4.3)
Salesforce.com
Winter' 2014


Tuesday 11 September 2012

Retrieving information from child to parent incase of standard objects using SOQL

[SELECT Id, Name,(select id,name from contacts) FROM Account]

* In above query, use contacts instead of contact

Governor Limits for single apex class or entire organization

Number of SOQL queries: 0 out of 100

Number of query rows: 0 out of 50000

Number of SOSL queries: 0 out of 20

Number of DML statements: 1 out of 150

Number of DML rows: 5 out of 10000

Number of script statements: 35 out of 200000

Maximum heap size: 0 out of 6000000

Number of callouts: 0 out of 10

Number of Email Invocations: 0 out of 10

Number of fields describes: 0 out of 100

Number of record type describes: 0 out of 100

Number of child relationships describes: 0 out of 100

Number of picklist describes: 0 out of 100

Number of future calls: 0 out of 10


Count against single apex class, not for entire organization

Upsert

* upsert sObject​​ opt_external_id
* opt_external_id​​ is an optional variable that specifies the custom field that should be used to match records that already exist in your organization's data
How Upsert Chooses to Insert or Update
Upsert uses the sObject record's primary key (or the external ID, if specified) to determine whether it should create a new object record or update an existing one:
  • If the key is not matched, then a new object record is created.
  • If the key is matched once, then the existing object record is updated.
  • If the key is matched multiple times, then an error is generated and the object record is neither inserted or updated.


Refer:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dml_upsert.htm

Labels