• vish
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 1
    Replies
Hello all,
 
I am having problems tying a campaign to a lead. I am able to get a campaign using the campaignID and then set the campaign on the lead, I dont get any errors but the lead doesnt post in salesforce.
 
I have read the API and searched the discussion boards and cannot find anything useful. I have been struggling with this issue for 2 days and have contacted sales force support as well.
 
 
The code follows.
 
The method to find the campaign using a campaign ID
Code:
    private static Campaign getCampaign(String campaignID) {
     
     log.debug("looking for campaign with id [" + campaignID + "]");
     Campaign campaign = new Campaign();
     try {
      StringBuffer sb = new StringBuffer();
      sb.append("Select Name From Campaign where id = '");
      sb.append(campaignID);
      sb.append("'");
      log.debug("running query: " + sb.toString());
      QueryResult result = binding.query(sb.toString());
      
      if (result.getRecords().length > 0) {
       campaign = (Campaign) result.getRecords(0);
       log.debug("campaign [" + campaign.getName() + "] found");
      }
     } catch (RemoteException e) {
      e.printStackTrace();
     }
  return campaign;
     
    }

 
Here, I set the campaign on the lead and other fields on the lead.
Code:
Lead lead = new Lead();
lead.setCampaign(getCampaign(campaignID));

 I dont see any errors, but the lead doesnt post. Once I comment out setting the campaign, the lead posts successfully.
Please help.
 
Thanks,
-Vish
  • October 15, 2007
  • Like
  • 0
When I am trying to create a lead using
 
Code:
         sObjects[0] = lead;
         SaveResult[] saveResult = binding.create(sObjects);

 
i get the error 'CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY'. Is this because of a setting in the permissions?
 
Thanks
  • September 27, 2007
  • Like
  • 0
Hi all,
 
The wsdl that I have got from a client compiles and creates the java objects. But the build fails and the error I see is "too many parameters". I checked in the wsdl and the particular type has about 400 elements.
 
Is there a way to get around this.
 
Please help!
 
Thanks,
-vish
  • September 27, 2007
  • Like
  • 0
I just got a salesforce account and i dont have any leads and havent setup any contacts. But when i use the code sample on the APEX quick start and change the query to display leads, it prints out a list of leads.
 
I am confused. I am using the same login information on the java application as the login for the website.
 
I am no sure if I am  missing anything?
 
Any help is appriciated.
 
Thanks.
  • September 25, 2007
  • Like
  • 0
I am using the example from the salesforce API quick start. I have used wsdl2java target to generate the stubs. But when I try to run the example , I cannot find the SessionHeader class or the QueryOptions object.
 
Please help!
Thanks.
  • September 25, 2007
  • Like
  • 0
I am a newbie to APEX. I am trying to do a webToLead using the API. I used to post a lead before. This is as far as I have gotten so far:
 
1) created an account in salesforce
2) got the enterprise WSDL and compiled the java objects.
 
Now i donno how to procede further, Do I have to login to SF using the API before I can do an INSERT or 'UPSERT'?
 
I was  never logging in before, when I was using the HTTP POST.
 
Any help is appricieated.
 
Thanks all.
  • September 24, 2007
  • Like
  • 0
I am using the example from the salesforce API quick start. I have used wsdl2java target to generate the stubs. But when I try to run the example , I cannot find the SessionHeader class or the QueryOptions object.
 
Please help!
Thanks.
  • September 25, 2007
  • Like
  • 0