Apex, Development, General
  • Salesforce Lightning UI and what it means for developers!
  • Salesforce Lightning UI and what it means for developers!
  • Salesforce Lightning UI and what it means for developers!
  • Salesforce Lightning UI and what it means for developers!
  • Salesforce Lightning UI and what it means for developers!

Salesforce Lightning UI and what it means for developers!

It can be summed up in one word. Javascript. It’s a hell of a tide change for Salesforce. So long Visualforce, hello lightning components! They are coming mainstream!

So, what does this mean for developers? Is Salesforce switching off the old UI? No… well not yet, too many companies have invested too much in it and VisualForce. Are they switching off Visualforce? will you still be able to develop VisualForce? Yes of course.

The Lightning UI is still a little way off from being complete. One of the reasons is that it doesn’t have a vast amount of components that VisualForce has, but this is defiantly going to change! With Lightning Components your creating a whole application rather than just a page in VisualForce, so the complexity is higher than regular VisualForce. Read more

Searching existing contacts based on a lead

Searching existing contacts based on a lead

I went to the London user group last year and quite a few people were interested in an app which when your looking at a lead automatically searches for existing records within salesforce. So I’ve just created a quick Salesforce app to allow you to search existing contacts based on a lead. It only searches contacts at the moment but I’ll get it to search other objects too if people are interested in it. Its also limited to just searching based on email address at the moment as well, but again if people are interested i’ll expand it.

Lead EmailAddress = [Select l.Email from Lead l WHERE l.Id = :this.thisLead.Id];

System.debug('getContacts Lead: ' + EmailAddress);

contactObj = [Select
c.Name,
c.AccountId,
c.Email,
c.FirstName,
c.Id,
c.LastName,
c.Salutation,
c.Title
from Contact c
WHERE c.Email = :EmailAddress.Email ];

return contactObj;
}
}

Create a searchContacts Page:
<apex:page standardController="Lead" extensions="searchContacts">
<apex:pageBlock >
<apex:pageBlockTable value="{!contacts}" var="item">
<apex:column value="{!item.Name}" />
<!--            <apex:column value="{!item.Id}" />-->
<apex:column value="{!item.AccountId}"/>
<apex:column value="{!item.Title}" />
<apex:column value="{!item.Email}" />
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

In the page above i’ve just pulled out Name, AccountId, Title & Email fields, but if you have custom fields or other fields you want to pull out just copy one of the apex:column lines and change the field name (!item.xxxxx)

Next all you need to do is add the visualforce page to the Lead page layout, also don’t forget if you have different profiles that you go in to them and give access to the visualforce page otherwise other users won’t be able to see the visualforce page.

Bingo!