• hankrearden
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies

I have triggers in place that will prevent duplicate leads.  In the trigger i use the

Lead.Email.addError() method to put the message that prevents the lead from being created. The problem is when i import a list of leads and there is one duplicate the entire import fails. 

 

Is there an alternate way to prevent the duplicate but not cause the import to fail?

 

thanks

Hi ,

I am trying to invoke a REST  web service through Force.com (Visual Force) as mentioned in the example provided in :

http://wiki.apexdevnet.com/index.php/Force.com_Zillow_Mashup

The code for the page editor is as follows:

Code:
<apex:page standardController="Lead" extensions="ZillowLeadExtension">
    <apex:form >  
    <!-- Insert new Lead -->
    <apex:pageBlock title="New Lead" >        
        <apex:pageBlockButtons location="top">                                  
           <apex:commandButton action="{!save}" value="Save" id="saveLead" />       
        </apex:pageBlockButtons>
       <apex:pageBlockSection title="Lead Data" columns="1"> 
          <apex:inputField value="{!aLead.LastName}" />
          <apex:inputField value="{!aLead.FirstName}" />
          <apex:inputField value="{!aLead.Company}" />                                       
          <apex:inputField value="{!aLead.Phone}" />
          <apex:inputField value="{!aLead.Email}" />
          <apex:inputField value="{!aLead.Street}" />
          <apex:inputField value="{!aLead.City}" />
          <apex:inputField value="{!aLead.State}" />
          <apex:inputField value="{!aLead.PostalCode}" />
      </apex:pageBlockSection>
   </apex:pageBlock>
  </apex:form>
 </apex:page>


 
the code for the class ZillowLeadExtension is :

Code:
public class ZillowLeadExtension {
 public Lead aLead ;
 public ZillowLeadExtension(ApexPages.StandardController controller) {
  aLead = new Lead() ;      
 }

public PageReference save() {        
 PageReference pr ;
 try{
  ZillowService p = new ZillowService() ;
  // make the web service call out
  ZillowTypes.PropertySearchResponse r = p.searchZillow( aLead.Street, aLead.City, aLead.State) ;
  // store in custom field
  aLead.Home_Value__c = r.getZEstimateAmount() ;
  // insert new record into DB
  insert aLead ;
  // redirect to the newly inserted lead
  pr = new PageReference( '/' + aLead.id );
 }
  catch( ZillowTypes.ZillowException e){
  System.debug( '**** Caught Exception' +e ) ;
}
 return pr ;
}
}


 
I have included all the other classes on which ZillowLeadExtension depends.When I try to save the Code written in the page editor , I am getting the following error:

 

ErrorError: Unknown property 'LeadStandardController.aLead'
 
Why is it not taking the ZillowLeadExtension class?
is there any other way to include the class??
 
Please Help..
 
 
Regards,
Diti
<SCRIPT type=text/javascript>// var tabId = getCookie('dmTab'); var closeButtonId = 'thePage:theForm:closeButton'; if (tabId && getBottomPanelHeight() > 28) { showCloseButton(closeButtonId, true); } else { showCloseButton(closeButtonId, false); } document.getElementById('thePage:theForm:showControllerLink').style.display = (false) ? 'inline' : 'none'; // </SCRIPT>
  • November 13, 2008
  • Like
  • 0