function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
QuantumMechanicQuantumMechanic 

Question on Gmaps

Help Please.

I've got the gmaps working for the most part; the only exception is that it does not provide any hits when I enter in a date parameter. I've used the explorer tool to get an error message but my eyes are going...can someone help?

Here's the error:

Query failed: MALFORMED QUERY:

(CreatedDate >= 2005-08-25T11:26:16: )

unexpected char.

How do I need to set up the date?

This is the entire query:

Select id, lastname, firstname, street, city, state, postalcode, company, title, website, email, lat__c, lon__c, Phone, MobilePhone, Fax, ConvertedDate from lead where (City != Null) and (IsConverted = false) and (ConvertedDate >= 2005-08-25T16:50:47: )

 

 

 

 

Message Edited by QuantumMechanic on 08-26-2005 04:53 PM

Message Edited by QuantumMechanic on 08-26-2005 04:55 PM

QuantumMechanicQuantumMechanic

Now if I use this syntax in SForce Explorer I still get errors.

YYYY-MM-DDThh:mm:ss

Has anyone been able to get the date to work using gmaps?

Cheers.

 

 

SuperfellSuperfell
you need to include the TZ offset, e.g. 2005-05-05T13:00:00Z
QuantumMechanicQuantumMechanic
Simon Thanks. I've got that syntax working in the query but am uncertain as to augmenting the actual SForce control using this syntax.
DevAngelDevAngel

There is a bug in the toolkit that is preventing submitting a correctly formatted date.

To work around this issue until the fix is posted, include the following code in your scontrol.

function toIsoDateTime(theDate) {
	var today = theDate;
	var year  = today.getFullYear();
	if (year < 2000) {    // Y2K Fix, Isaac Powell
		year = year + 1900; // http://onyx.idbsu.edu/~ipowell
	}
	
	var month = today.getMonth() + 1;
	var day  = today.getDate();
	var hour = today.getHours();
	var hourUTC = today.getUTCHours();
	var diff = hour - hourUTC;
	var hourdifference = Math.abs(diff);
	var minute = today.getMinutes();
	var minuteUTC = today.getUTCMinutes();
	var minutedifference = Math.abs(minute - minuteUTC);
	var second = today.getSeconds();

	if (hourdifference + minutedifference == 0) {
		timezone = "Z";
	} else {
		if (diff > 0) {>
			var pm = "+";
		} else {
			var pm = "-";
		}
		if (minutedifference < 10) {
			minutedifference = "0" + minutedifference;
		}

		if (hourdifference < 10) { 
			timezone = pm + "0" + hourdifference + ":" + minutedifference;
		} else {
			timezone = pm + hourdifference + ":" + minutedifference;
		}
	}

	if (month <= 9) month = "0" + month;
	if (day <= 9) day = "0" + day;
	if (hour <= 9) hour = "0" + hour;
	if (minute <= 9) minute = "0" + minute;
	if (second <= 9) second = "0" + second;

	return       year + "-" + month + "-" + day + "T" + hour + ":" + minute + ":" + second + timezone;
	var retval = year + "-" + month + "-" + day + "T" + hour + ":" + minute + ":" + second + timezone;	
	
	return  retval;
}
 
QuantumMechanicQuantumMechanic

Hi Dave, thanks for the quick reply. I've augmented my code with your function however, now the page will

not load whatsoever.

Do you have an entire working script?

 

DevAngelDevAngel
Point your sforceClient.js script to http://sandbox.sforce.com/ajax/beta1.  This has the fixed scripts in it.
QuantumMechanicQuantumMechanic
Forbidden...don't have access.
DevAngelDevAngel

Of course, you will have to specify the the js file

http://sandbox.sforce.com/ajax/beta1/sforceclient.js

QuantumMechanicQuantumMechanic

No dice on that new script.

From the UI selecting leads created within the last 24 hours does not return any data.

This is the output I get when turning the diagnostics on:

Select id, lastname, firstname, street, city, state, postalcode, company, title, website, email, lat__c, lon__c, Phone, MobilePhone, Fax from lead where (City != Null) and (IsConverted = false) and (CreatedDate >= 2005-08-29T11:15:05
No records matched the query.