• Sassberto
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I am performing a very simple SOQL query -

//SOSL query to send to SFDC.
string SOQLQuery = "select ID,Email,FirstName,LastName from lead where email = '" + emailAddress + "'";

// Invoke the query call and save the result in a QueryResult
qr = Binding.query(SOQLquery);

The first time the code runs, it returns no matches and I create a lead. If I convert the lead in SFDC and then run again, qr is returning a lead, even though no such lead exists that I can find. It has an ID and the data is there. I checked isConverted and it is false. I'm thinking this is a perms issue in SFDC, in that it was created with another user, but I have sysadmin perms as does the other user who would have run this code. Any ideas?
I have created a class called WebLead which inherits sforce.Lead.

When I atttempt to pass the derived class to create() I get an error that 'WebLead was found, expected sforce.Lead'. I have tried explicitly casting WebLead to it's base class but I still get the same error.

Ideally I want to something do this:

class WebLead : Lead
{
public Save()
{
sObject[] obj = { this };

sforce.create(obj)
}
}

instead I have to do

class WebLead : Lead
{
public Save()
{
Lead myLead = new Lead();
myLead.FirstName = this.FirstName;
myLead.LastName = this.LastName;
//etc.. ad nauseum

sObject[] obj = { myLead };

sforce.create(obj)
}
}

Any ideas here?
I am performing a very simple SOQL query -

//SOSL query to send to SFDC.
string SOQLQuery = "select ID,Email,FirstName,LastName from lead where email = '" + emailAddress + "'";

// Invoke the query call and save the result in a QueryResult
qr = Binding.query(SOQLquery);

The first time the code runs, it returns no matches and I create a lead. If I convert the lead in SFDC and then run again, qr is returning a lead, even though no such lead exists that I can find. It has an ID and the data is there. I checked isConverted and it is false. I'm thinking this is a perms issue in SFDC, in that it was created with another user, but I have sysadmin perms as does the other user who would have run this code. Any ideas?
I know this has to be documented somewhere, but I don't see it in the Web Services api documentation, samples or anywhere in this forum. But I SWEAR I looked.

I want to do the most generic query on the sforce types: returning all the complete objects. I want to do the equivalent of select * from Contacts (or possibly returning complete objects: select from Contacts). All I see are queries that require fieldlists, and I don't want to have to list them all since I need the complete object.

There must be a way to do this. Can someone please point me in the correct direction?

Thanks in advance.