Author Archive nayakdillip

Bynayakdillip

How to create community site using salesforce

Step:-1 Search Communities To Enable
From setup,enter communities setting in the quick search box.Then select communities setting

Step:-2 Enable Communities then save
Select a domain for your communities.then check Availability after check its show the message “success !Domain name available” .Then save

Step:-3 Create Communities
Click on the New Community button its redirect to lighting bolt where you chose the template

Step:-4 Choose one of the template Like
i.Customer Service (Napili)
ii.Customer Account Portal
More……
Also, you can create your own template

Step:-5 Here i have choose sale –>partner central

Step:6 After chose the template. you need to click on the “Get Started ” button , Pass the name then click the create button

Its take few time to build

step:6 once its created its redirect to the community work space

step-7 Click on the builder to build publish the site.on the right corner after customization you need to publishing the site

Step:-8 After successfully published its sows like this

Bynayakdillip

Navigate to lightning from visualforce page

On visualforce page you need to add below code.If you need to redirect to lightning page on button click or page load .You use below code

<script>
 window.onload=function(){ 
 //get record ID
        var recordid='{!$CurrentPage.parameters.Id}';//Its depend open your record id
if( (typeof sforce != 'undefined') && sforce && (!!sforce.one) ) {
            setTimeout(function(){
                // Salesforce1 navigation(Lightning Experience)
                sforce.one.navigateToURL('/'+recordid);
            }, 10);
}
}
</script>
Bynayakdillip

Create Hello World Lightning Component

Hello World Lightning Component

Step:-1: Login to Salesforce dev Org

https://login.salesforce.com/

Step:-2 Open Developer Console

Step:3 Create Lightning Component
File–>New–>Lightning Component

After Click on the lightning component, Enter Name and Description for the component.

Paste the below code over the component

<!--HelloWorldCMP-->
<aura:component >
	<p> Hello World </p>
</aura:component>

Also, you can add CSS on Click Style

CSS CODE

.THIS {
    width:100px;
    height:100px;
}

Step:-3 Create Lightning Application page For test the Lightning Componenet
File–>New–>Lightning Application

After click on the Lightning Application, Enter Name and Description for the page

Step:-4 Use your created Component over lightning application page

<aura:application >
	<c:HelloWorldCMP></c:HelloWorldCMP>
</aura:application>

Paste the below code

Step:-5 preview the page on click preview button

Output:-

Bynayakdillip

salesforce lightning navigate to record

$A.get(“e.force:navigateToSObject”) help you to navigate the sobject record for more detail please check below example

Apex Controller Class

public with sharing class AccountsController {
@AuraEnabled
public static list getAllAccounts()
{
return [select id,name,phone from account where phone!=null];
}
}

Component

<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="AccountsController" >
	<aura:attribute name="accounts" type="list"></aura:attribute>
     <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:iteration var="account" items="{!v.accounts}">
        <lightning:card variant="Narrow" title="{!account.Name}">
        <aura:set attribute="actions">
            <lightning:button name="details" label="Details" onclick="{!c.goToRecord}"  />
        </aura:set>
        <aura:set attribute="footer">
            <lightning:badge label="{!account.Name}"/>
        </aura:set>
        <p>
           <a onclick="{!c.goToRecord}">{!account.Name}</a> 
        </p>
        <p>
            {!account.Phone}--{!account.Id}
        </p>
    </lightning:card>
    </aura:iteration>
</aura:component>

Controller JS

({
    doInit : function(component, event, helper) {
        
        var action=component.get("c.getAllAccounts");
        action.setCallback(this,function(response){
            
            var state=response.getState();
            if(state==="SUCCESS")
            {
                component.set("v.accounts",response.getReturnValue());
            }
            
            
            
        });
        $A.enqueueAction(action);
		
	},
    goToRecord:function(component, event, helper)
    {
        
        var sobjectEvent=$A.get("e.force:navigateToSObject");
        sobjectEvent.setParams({
            
            "recordId": component.get("account.Id")

        });
        sobjectEvent.fire();
        
    }
    
})

Made a lightning app using Lightning app builder to run it

Bynayakdillip

How do I change the background theme in Lightning App Builder?

In Setup–>Themes and Branding in the Quick Find box, then select Themes and Branding, and select Hide.

Bynayakdillip

ng-repeat load data but wont show until i click some button

ng-repeat load data but wont show until i click some button

Just apply

 

$scope.apply();

 

Cheer!!!

Bynayakdillip

Unable to Generate a Temporary Class

This error occurs winter’15 release.when you integrate WSDL over .net application

Step 1: Open the wsdl file.

Step:2 Find ListViewRecord

  1. <complexType name=“ListViewRecord”>
  2.    <sequence>
  3.       <element name=“columns” type=“tns:ListViewRecordColumn” maxOccurs=“unbounded”/>
  4.    </sequence>
  5. </complexType>

Step 3: Add “<xsd:attribute name=”tmp” type=”xsd:string” />”.

Over this section
  1. <complexType name=“ListViewRecord”>
  2. <sequence>
  3. <element name=“columns” type=“tns:ListViewRecordColumn” maxOccurs=“unbounded”/>
  4. </sequence>
  5. <xsd:attribute name=“tmp” type=“xsd:string” />
  6. </complexType>

Step 4: Update the webservice.

Now build the application its working like champ.