• CaptaConsulting
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 7
    Replies
Hi,

When I execute my AJAX code:

........

_qrLeads = sforceClient.Query("Select Id, LastName, FirstName, State, Email , CreatedDate, LastModifiedDate, OwnerId From Lead where CreatedDate >= 2005-01-01 and CreatedDate
alert("_qrLeads: "+_qrLeads)

........

I get this error:

_qrLeads: faultstring: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.
faultcode: soapenv:Server
SOQL: Select Id, LastName, FirstName, State, Email , CreatedDate, LastModifiedDate, OwnerId From Lead where CreatedDate >= 2005-01-01 and CreatedDate

If I executed this query in the sforce Explorer works perfect.

Thanks.
Hi,

i am trying to adds leads to a campaign with the AJAX toolkit beta1 and the CampaignMember object, but it fails.

A snippet of code:

..........

sforceClient.setBatchSize(10);
_qrLeads = sforceClient.Query("Select Id, LastName, FirstName, State From Lead where State = '"+provincia+"'");

if (_qrLeads.size > 0) {
for (var i=0;i var lead = _qrLeads.records[i];
var campMember = new DynaBean("CampaignMember");
campMember.set("CampaignId","{!Campaign_ID}");
campMember.set("LeadId",lead.id);
campMember.set("Status","Sent");
var saveResult = sforceClient.Create(campMember)[0];
}
}

.......

Any Help??

Thanks.

Victor Alvarez Fuente
Hi,

I am doing an Sforce Control with javascript and I need to know which are the possible values of a field with type picklist because i need to compare this values with other field.

I hava seen in the forum how to do it in JAVA calling the "describeSObject" instruction, but not in javascript or vbscript

I have tried this, but id doesn´t work.

.................

var sfdc = new ActiveXObject('SForceOfficeToolkit.SForceSession');
sfdc.SetServerUrl('{!API_Enterprise_Server_URL_50}');
sfdc.SessionId = '{!API_Session_ID}';

var newCItems = new Array(1);
newCItems[0] = sfdc.describeSObject('Contract');
var e2 = new Enumerator(newCItems);
var sobj2 = e2.item();

document.writeln("PICKLIST VALUE 0 = " + sobj2.item('Status').picklistValues[0].value);
document.writeln("PICKLIST VALUE 1 = " + sobj2.item('Status').picklistValues[1].value);
document.writeln("PICKLIST VALUE 2 = " + sobj2.item('Status').picklistValues[2].value);

.................


Any clue, code or help?

Thanks.

Victor Alvarez

Hi, I have a problem, i need to do something like that in a field with type date:

 

sobj2.item('StartDate').value = sobj.item('EndDate').value + 1;

 

but this give me an error.

Anyone can help me?

 

Thanks.

Víctor �lvarez

 

 

 

While adding the campaing to a lead/contact, I am asked for the status which is "Sent" or "Responded".

Can I access this "Status" picklist through API? Does this resides in campaing member, but status field in campaingmember consists of a larger set of values. I mean the total of all values across all campaings - "Added through the 'Advanced Setup' on Campaign".

Please help me.

Thanks,