• rbenson
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 5
    Replies

Hi,

 

I just installed the Find Nearby Accounts app and am having a couple problems:

 

  1. For the addresses that are working, when I click the Map it, I am only able to see the map, not the list of companies like the screen shot shows or the video tutorial
  2. We have a custom field for the industries but I only see the standard list when searching for an account – can we customize these filters?

 

Any help is appreciated. Thank you.

 

Regards,

Rachel

I need some help with customizing a trigger. We use custom fields for addresses and would like to build a trigger to allow us to perform a radius search on zip codes or addresses. There is an app that lets you do this for standard address fields called FindNearbyAccounts. I am trying to rewrite the code to fit our org but i'm having trouble.

 

any thoughts?

 

current code:

trigger FindNearbyAccounts_KeepTidy on Account (before update) {
     for(Integer k=0; k<Trigger.new.size(); k++)
     {
        Boolean reset = false; 
        //If they change which Address to map 
        if(Trigger.new[k].Which_Address__c != Trigger.old[k].Which_Address__c)
        {
            reset = true; 
        }
        
        if(Trigger.new[k].Which_Address__c == 'Billing')
        {
            if(Trigger.new[k].BillingStreet != Trigger.old[k].BillingStreet || Trigger.new[k].Billingcity != Trigger.old[k].BillingCity ||
               Trigger.new[k].BillingPostalCode != Trigger.old[k].BillingPostalCode || Trigger.new[k].BillingState != Trigger.old[k].BillingState || Trigger.new[k].BillingState != Trigger.old[k].BillingState
               || Trigger.new[k].BillingCountry != Trigger.old[k].BillingCountry )
            {   
               reset = true;  
               
            }
        }
        else if(Trigger.new[k].Which_Address__c == 'Shipping')
        {
     
            if(Trigger.new[k].ShippingStreet != Trigger.old[k].ShippingStreet || Trigger.new[k].Shippingcity != Trigger.old[k].ShippingCity
             ||Trigger.new[k].ShippingPostalCode != Trigger.old[k].ShippingPostalCode || Trigger.new[k].ShippingState != Trigger.old[k].ShippingState  ||
             Trigger.new[k].ShippingCountry != Trigger.old[k].ShippingCountry)
            {
                  reset = true;  
            }
        }
        
        if(reset){
            Trigger.new[k].FNA_Status__c = 'Not Located Yet';
            Trigger.new[k].Lat__c = null;
            Trigger.new[k].Lon__c = null;
        }
        
     }//end FOR
}

 what i've tried to write:

trigger FindNearbyAccounts_KeepTidy on Account (before update) {
     for(Integer k=0; k<Trigger.new.size(); k++)
     {
        Boolean reset = false; 
        //If they change which Address to map 
        if(Trigger.new[k].Which_Address__c != Trigger.old[k].Which_Address__c)
        {
            reset = true; 
        }
        if(Trigger.new[k].Which_Address__c == 'Account_Mailing__c')
        {
            if(Trigger.new[k])'Mailing_Address__c';Trigger.old[k];'Mailing_Address__c'; } Trigger.new[k];'Mailing_City__c' != Trigger.old[k];'Mailing_City__c' ||
               Trigger.new[k];'Mailing_Zip_Postal_Code__c' != Trigger.old[k];'Mailing_Zip_Postal_Code__c' || Trigger.new[k];'Mailing_States_Provinces_Territories__c' != Trigger.old[k];'Mailing_States_Provinces_Territories__c' || Trigger.new[k];'Mailing_States_Provinces_Territories__c' != Trigger.old[k];'Mailing_States_Provinces_Territories__c'
               || Trigger.new[k];'Mailing_Country__c' != Trigger.old[k];'Mailing_Country__c';
            {   
               reset = true;  
                           }
        }
              }              
   //end FOR

 

Followed steps to download IDE 3.5 and got the following error:

 

Cannot complete the install because one or more required items could not be found.
  Software being installed: Force.com IDE 19.0.0.201006111421 (com.salesforce.ide.feature.feature.group 19.0.0.201006111421)
  Missing requirement: Force.com IDE Core 19.0.0.201006111421 (com.salesforce.ide.core 19.0.0.201006111421) requires 'bundle org.eclipse.core.resources [3.3.0,3.6.0)' but it could not be found
  Cannot satisfy dependency:
    From: Force.com IDE 19.0.0.201006111421 (com.salesforce.ide.feature.feature.group 19.0.0.201006111421)
    To: com.salesforce.ide.core [19.0.0,20.0.0)

We have a custom object on the task field called Activity Type for the different types of activites our sales team performs - i.e. adding a new contact, sending a letter, etc.

 

What I am trying to accomplish is writing a class or trigger so that every time a new contact is added a trigger is fired to add a "log a call" and associate the activity type "1 - identify a new contact"

 

Any ideas? I have tried an if, then code and a few other triggers but nothing has worked.

 

Thanks!

Rachel

I need some help with customizing a trigger. We use custom fields for addresses and would like to build a trigger to allow us to perform a radius search on zip codes or addresses. There is an app that lets you do this for standard address fields called FindNearbyAccounts. I am trying to rewrite the code to fit our org but i'm having trouble.

 

any thoughts?

 

current code:

trigger FindNearbyAccounts_KeepTidy on Account (before update) {
     for(Integer k=0; k<Trigger.new.size(); k++)
     {
        Boolean reset = false; 
        //If they change which Address to map 
        if(Trigger.new[k].Which_Address__c != Trigger.old[k].Which_Address__c)
        {
            reset = true; 
        }
        
        if(Trigger.new[k].Which_Address__c == 'Billing')
        {
            if(Trigger.new[k].BillingStreet != Trigger.old[k].BillingStreet || Trigger.new[k].Billingcity != Trigger.old[k].BillingCity ||
               Trigger.new[k].BillingPostalCode != Trigger.old[k].BillingPostalCode || Trigger.new[k].BillingState != Trigger.old[k].BillingState || Trigger.new[k].BillingState != Trigger.old[k].BillingState
               || Trigger.new[k].BillingCountry != Trigger.old[k].BillingCountry )
            {   
               reset = true;  
               
            }
        }
        else if(Trigger.new[k].Which_Address__c == 'Shipping')
        {
     
            if(Trigger.new[k].ShippingStreet != Trigger.old[k].ShippingStreet || Trigger.new[k].Shippingcity != Trigger.old[k].ShippingCity
             ||Trigger.new[k].ShippingPostalCode != Trigger.old[k].ShippingPostalCode || Trigger.new[k].ShippingState != Trigger.old[k].ShippingState  ||
             Trigger.new[k].ShippingCountry != Trigger.old[k].ShippingCountry)
            {
                  reset = true;  
            }
        }
        
        if(reset){
            Trigger.new[k].FNA_Status__c = 'Not Located Yet';
            Trigger.new[k].Lat__c = null;
            Trigger.new[k].Lon__c = null;
        }
        
     }//end FOR
}

 what i've tried to write:

trigger FindNearbyAccounts_KeepTidy on Account (before update) {
     for(Integer k=0; k<Trigger.new.size(); k++)
     {
        Boolean reset = false; 
        //If they change which Address to map 
        if(Trigger.new[k].Which_Address__c != Trigger.old[k].Which_Address__c)
        {
            reset = true; 
        }
        if(Trigger.new[k].Which_Address__c == 'Account_Mailing__c')
        {
            if(Trigger.new[k])'Mailing_Address__c';Trigger.old[k];'Mailing_Address__c'; } Trigger.new[k];'Mailing_City__c' != Trigger.old[k];'Mailing_City__c' ||
               Trigger.new[k];'Mailing_Zip_Postal_Code__c' != Trigger.old[k];'Mailing_Zip_Postal_Code__c' || Trigger.new[k];'Mailing_States_Provinces_Territories__c' != Trigger.old[k];'Mailing_States_Provinces_Territories__c' || Trigger.new[k];'Mailing_States_Provinces_Territories__c' != Trigger.old[k];'Mailing_States_Provinces_Territories__c'
               || Trigger.new[k];'Mailing_Country__c' != Trigger.old[k];'Mailing_Country__c';
            {   
               reset = true;  
                           }
        }
              }              
   //end FOR

 

We have a custom object on the task field called Activity Type for the different types of activites our sales team performs - i.e. adding a new contact, sending a letter, etc.

 

What I am trying to accomplish is writing a class or trigger so that every time a new contact is added a trigger is fired to add a "log a call" and associate the activity type "1 - identify a new contact"

 

Any ideas? I have tried an if, then code and a few other triggers but nothing has worked.

 

Thanks!

Rachel