Communities Self-Registration Visualforce Page

Below components are available in default for Communities Self-Registration

Visualforce Page: CommunitiesSelfReg

Apex Class: CommunitiesSelfRegController

Test Class: CommunitiesSelfRegControllerTest

The reference to entity "oid" must end with the ';' delimiter.

To fix  " The reference to entity "oid" must end with the ';' delimiter.", use &amp instead of & symbol in the URL.

Sample URL:

How to Close a Case from Salesforce1 mobile app?

1. Go to Buttons, Links, and Actions under Case.

2. Click "New Action".

3. Enter and select the details. Click "Save" button.

4. Drag and Drop the fields and click "Save" button.

5. Click New under Predefined Values.

6. Select as per the below image and click "Save" button.

7. Go the Case page layout.

8. Edit it.

9. Click override the predefined actions link.

10. Drag and Drop the quick action created under Salesforce1 and Lightning Experience Actions.

11. Go to Salesforce1 Mobile App.

12. Open a Case.

13. Tap Close Case.

14. Enter the details and click "Save".


How to show Closed Status in Case Edit page?

1. Go to Support Setting.

2. Enable "Show Closed Statuses in Case Status Field".

Lightning components in community builder

To use Lightning components in community builder, use implements="forceCommunity:availableForAllPageTypes".

Sample Code:

<aura:component implements="forceCommunity:availableForAllPageTypes">



How to import project from Microsoft TFS Server to Eclipse?

1. Go to File --> Import.

2. Select Team --> Projects from Team Foundation server.

3. Select the Project.

4. Select the Repository.

5. Go to Properties.

6. Enter your credentials.


How to check in Salesforce component changes using Microsoft TFS?

1. Right click the component to check in and select Check-In Pending Changes.

2. Enter the comments and click "Check-In".

Once the changes are committed to the Server, the white tick mark will be changed to yellow cylindrical symbol.


How to see Version History in Microsoft TFS?

1. Select Version History under the component.

2. Compare or view the changes.


How to redirect to page in Salesforce Community?

1. Get the community URL.

2. In Apex, construct the URL as below

Community URL/s/ Page Name

Check the below link for more information


How to activate Community in Salesforce?

1. Go to All Communities.

2. Click Manage link under the Community which you want to activate.

3. Under Administration, select Settings and click "Activate Community".

How to publish the Community?

1. Go to All Communities.

2. Click Manage link under which Community you want to publish.

3. Select Go to Community Builder.

5. Click "Publish" button.

How to run Scheduler class instantly?

Sample code:

SchedulerClass obj = new SchedulerClass();


How to avoid duplicate in Custom object in Salesforce?

1. Go to Matching Rules.

2. Click New, select the object, Enter the Details and Save the rule.

3. Activate the Matching Rule.

4. Go to Duplicate Rules.

5. Create and save the Duplicate rule by selecting the matching rule created in the previous steps.

6. Activate the Duplicate Rule.



How to iterate map in Salesfore Lightning?

Apex Class:

public class LightningController {
    public static Map < String, String > fetchMapData() {
        Map < String, String > mapCustomer = new Map < String, String >();
        mapCustomer.put('Sample', 'Value');
        mapCustomer.put('Sample1', 'Value1');
        mapCustomer.put('Sample2', 'Value2');
        mapCustomer.put('Sample3', 'Value3');
        return mapCustomer;


<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" controller="LightningController">
    <ui:button label="Fetch" press="{!c.fetch}"/>
    <aura:attribute name="showBool" type="Boolean" default="false"/>
    <aura:attribute name="customers" type="List" />
    <aura:renderIf isTrue="{!v.showBool}">
        <aura:iteration items="{!v.customers}" var="cus" indexVar="key">
            {!cus.key} - {!cus.value}<br/><br/>


fetch : function(component, event, helper) {
        var custNo = component.get("v.custNo");
var action = component.get("c.fetchMapData");   
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {                
                var custs = [];
                var conts = response.getReturnValue();
                for ( var key in conts ) {
                    custs.push({value:conts[key], key:key});
                component.set("v.customers", custs);
                component.set("v.showBool", true);


<aura:application >




Simple REST API for XML response in Salesforce

Sample code:

Map < String, String > mapCustomer = new Map < String, String >();
String endpoint = '';
HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
HTTPResponse res = h.send(req);
Dom.Document doc = res.getBodyDocument();
Dom.XMLNode customer = doc.getRootElement();
for(Dom.XMLNode child : customer.getChildElements()) {
       mapCustomer.put(child.getName(), child.getText());


System.CalloutException: Method can not be null

If you face System.CalloutException: Method can not be null issue, make sure you are using POST Or GET Or PUT in your request.

Sample Code:

  1. HTTPRequest req = new HTTPRequest();  
  2. req.setEndPoint('End Point URL');  
  3. req.setMethod('GET');  

How to share Salesforce project to TFS?

1. Right click the project and select Share Project.

2. Select Team Foundation Server.

3. Select the server.

4. Select the Location.

5. Click "Finish".

6. Check In the components after sharing. To Check In, right click the project folder, select Team --> Check In Pending Changes.


Team Share Project disabled

If Team --> Share  Project is disabled, open the project.

Right Click the project in the Project Explorer and click "Open Project" to open the project and avoiding Share Project option disabled.


Features not available for external objects in Salesforce

To know the features that are not available for external objects in Salesforce, check the below link


How to avoid duplicate account creation in Salesforce?

1. Go to Matching Rules.

2. Activate the standard rules.

3. Go to "Duplicate Rules".

4. Click New and select the object. I have selected Account for this example.

5. Enter the details and save.

6. Activate the Duplicate Rule.



Formula field to find the last day of the month in Salesforce?

Sample Formula code:

IF( MONTH( TODAY() ) = 12, 
DATE( YEAR( TODAY() ), 12, 31 ), 
DATE( YEAR( TODAY() ), MONTH( TODAY() ) + 1, 1) - 1)


How to cover the test coverage for getURL method?

To cover the test coverage for getURL method, use Test.setCurrentPage(Page.PageName).

Test.setCurrentPage(Page.PageName) will help you to cover the codes which makes use of ApexPages.currentPage().getUrl().


Formula field to find day of the week in Salesforce?

Sample code:

MOD(TODAY() - DATE(1900, 1, 7), 7), 
1, 'Sunday', 
2, 'Monday', 
3, 'Tuesday', 
4, 'Wednesday', 
5, 'Thursday', 
6, 'Friday', 


Health Check in Salesforce

Health Check lets you identify and fix security vulnerabilities in your password policies, network access configuration, and session settings, all from a single page. A summary score shows how your org measures against the Salesforce-recommended baseline.

Go to Security Controls --> Health Check.


Lightning Connect

Lightning Connect provides seamless integration of data across system boundaries by letting your users view, search, and modify data that’s stored outside your Salesforce organization. For example, perhaps you have data that’s stored on premises in an enterprise resource planning (ERP) system. Instead of copying the data into your org, you can use external objects to access the data in real time via web service callouts.

Check the below link for step by step process to implement


Lightning Basic UI Elements

Sample Code:
Component Code:
<aura:component >
    <!--<aura:attribute name="newAccount" type="Account"/>
    <ui:inputText label="Account Name" value="{!v.newAccount.Name}"/>
    <ui:inputText label="Account Number" value="{!v.newAccount.AccountNumber}"/>
    <ui:button label="Create Account" />-->
    <ui:inputText label="Text Box"/><br/><br/>
    <ui:inputCheckBox label="Check Box"/><br/><br/>
    <ui:inputNumber label="Number"/><br/><br/>
    <ui:inputDateTime label="Date and Time"/><br/><br/>
    <ui:inputDate label="Date"/><br/><br/>
    <ui:inputDateTime label="Date and Time with Date Picker" displayDatePicker="true"/><br/><br/>
    <ui:inputDate label="Date with Date Picker" displayDatePicker="true"/><br/><br/>
    <ui:inputRadio label="Radio Button"/><br/><br/>
    <ui:inputSelect label="Single Pick List">
        <ui:inputSelectOption text="Red"/>
        <ui:inputSelectOption text="Green" value="true"/>
        <ui:inputSelectOption text="Blue"/>
    <ui:inputSelect multiple="true" label="Multi Pick List">
        <ui:inputSelectOption text="All Primary" label="All Contacts"/>
        <ui:inputSelectOption text="All Primary" label="All Primary"/>
        <ui:inputSelectOption text="All Secondary" label="All Secondary"/>
    <ui:button label="Button"/>    

App Code:
<aura:application >



How to call Future methods from Process Builder?

To call Future methods from Process Builder, call the future method from the in-vocable method. Check the below code.

Sample Code:

public class LightningProcessBuilder {
    public static void sendEmailToOwner(List<String> listUserNames) {
    public static void callEmailSend(List<String> listUserNames) {
        //Write the logic.
       //If it is a call out, use callout = true in future annoation


How to check supported currencies in Salelsforce organization?

Go to Company Profile --> Manage Currencies.

The Active Currencies sections show the supported currencies in Salelsforce organization.