• eBiz03
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi All,

 

I am very new to this type of developement so please bear with me. Hoping someone can at least point me in the right direction to get started.

 

I am looking to develop a custom button on the Account object that would query an external application using API calls and create a new Account in that application using the Salesforce Account data if that Account does not exist. I have the API calls for the application. How should I approach this?

 

Thanks in advance for your assistance.

I would be so grateful if anyone could help with a test class for my controller. New to apex and trying to get this in my production environment. Thanks in advance for any help.

 

public with sharing class massupdatefield{

public List<Contact> contacts{get; set;}
public list<selectoption> options{Get; set;}
public string selected{get; set;}
String saveUrl = ApexPages.currentPage().getParameters().get('retURL');

public massupdatefield(apexpages.standardsetcontroller ssc){
    contacts = (list<contact>)ssc.getSelected();
    Schema.DescribeFieldResult FR = Contact.Rep_Call_List__c.getDescribe();
    List<Schema.PicklistEntry> PL = FR.getPicklistValues();
    options = new list<selectoption>();
    for(schema.PickListEntry p:PL){
       options.add(new selectoption(p.getLabel(), p.getvalue()));
    }
 
}

public pagereference updatecontacts(){

for(Contact c:contacts){
     c.Rep_Call_List__c = selected;
    }
   update contacts;

return new pagereference(saveurl);
}
}

  • April 26, 2011
  • Like
  • 0

Hi All,

 

Looking for some help creating a test method for the code below. New to Apex and running in to errors installing the Force.com IDE so any help is much appreciated.

 

public with sharing class massupdatefield{

 

public List<Contact> contacts{get; set;}
public list<selectoption> options{Get; set;}
public string selected{get; set;}
String saveUrl = ApexPages.currentPage().getParameters().get('retURL');

public massupdatefield(apexpages.standardsetcontroller ssc){
    contacts = (list<contact>)ssc.getSelected();
    Schema.DescribeFieldResult FR = Contact.Rep_Call_List__c.getDescribe();
    List<Schema.PicklistEntry> PL = FR.getPicklistValues();
    options = new list<selectoption>();
    for(schema.PickListEntry p:PL){
       options.add(new selectoption(p.getLabel(), p.getvalue()));
    }
 
}

public pagereference updatecontacts(){

for(Contact c:contacts){
     c.Rep_Call_List__c = selected;
    }
   update contacts;

return new pagereference(saveurl);
}
}

  • April 22, 2011
  • Like
  • 0

Hi All,

 

Looking for some help creating a test method for the code below. New to Apex and running in to errors installing the Force.com IDE so any help is much appreciated.

 

public with sharing class massupdatefield{

 

public List<Contact> contacts{get; set;}
public list<selectoption> options{Get; set;}
public string selected{get; set;}
String saveUrl = ApexPages.currentPage().getParameters().get('retURL');

public massupdatefield(apexpages.standardsetcontroller ssc){
    contacts = (list<contact>)ssc.getSelected();
    Schema.DescribeFieldResult FR = Contact.Rep_Call_List__c.getDescribe();
    List<Schema.PicklistEntry> PL = FR.getPicklistValues();
    options = new list<selectoption>();
    for(schema.PickListEntry p:PL){
       options.add(new selectoption(p.getLabel(), p.getvalue()));
    }
 
}

public pagereference updatecontacts(){

for(Contact c:contacts){
     c.Rep_Call_List__c = selected;
    }
   update contacts;

return new pagereference(saveurl);
}
}

  • April 22, 2011
  • Like
  • 0

Here's a custom button formula created on the opportunity object that will allow you to find duplicate opportunities from an individual opportunity record:

 

 

/search/SearchResults?searchType=2&str={!
Opportunity.Name}*&search=Search&sen=006

Here's a similar one that allows you to look for opportunities from an individual Lead record. This one was created on the Lead object:

 

 

/search/SearchResults?searchType=2&str={!
Lead.Company}*&search=Search&sen=006
Description

 

Not sure how many of you out there have or will ever have this requirement but I did and this is a good solution.

 

Best-

 

Jeremy