var dirty = (new Date()).getTime(); var query = new esri.tasks.Query(); query.where = "MyField= " + MyValue+ " AND " + dirty + "=" + dirty; ...
Cory,Thanks for the idea but there's no equivalent to disableClientCaching in the JS API. I've used that in the SL api in the past to make sure data from a feature layer based on a query layer (pulling lat/longs from SQL server) would refresh after the underlying DB was updated.TG
The workarounds areyou can do request in POSTordirty the query var dirty = (new Date()).getTime(); var query = new esri.tasks.Query(); query.where = "MyField= " + MyValue+ " AND " + dirty + "=" + dirty; ...
var dirty = DateTime.UtcNow; Query query = new Query(); query.ReturnGeometry = true; query.OutFields.Add("*"); query.Where = QueryParametersTextbox.Text + " AND " + dirty + "=" + dirty;
string dirty = DateTime.UtcNow.Ticks.ToString(); Query query = new Query(); query.ReturnGeometry = true; query.OutFields.Add("*"); query.Where = QueryParametersTextbox.Text + " AND " + dirty + "=" + dirty;
I am on 10.2.2 all updates and patches applied and JS API 3.10 and I still have the issue. even sequencing the queries will not work, nor does the "dirty" query technique. I have not been able to make JS API to use POST yet (not sure if I can) and I am on enterprise geodatabase (postgres). Two queries back to back or simultaneous, the first one always successful, the second one fails. Reordering them guarantees that there is no issue with the query itself. Extremely frustrating...
Hi, still you have the same issue ?
ref ArcGIS Help (10.2, 10.2.1, and 10.2.2)
Sadanand.
No! I am not sure how did I solve it though. IT was a long time ago.
Even I had the same issue in Sliverlight api with server 10.2.1, FeatureLayer query fails when using date in where clause.
It works for me when change the query syntax like below:
featureLayer.Where = "SURVEY_DATE >= date '" + dpFromDate.SelectedDate.Value.ToString("yyyy-MM-dd")
+ "' and SURVEY_DATE <= date '" + dpToDate.SelectedDate.Value.ToString("yyyy-MM-dd") + "'";
ref the link for more details : ArcGIS Help (10.2, 10.2.1, and 10.2.2)
In case anyone else comes up against this bug working with a FeatureLayer in a dynamic workspace (which I did), I implemented the above workaround in JSAPI by adding a definitionExpression similar to above. For example:
var dirty = (new Date()).getTime();
var lyrDynamic = new FeatureLayer(
serviceurl + "/dynamicLayer"
,{
id: "dynamicLayer"
,mode: FeatureLayer.MODE_ONDEMAND
,outFields: ["CLASS"]
,source: layerSource
,definitionExpression: dirty + "=" + dirty
}
);
Cheers,
jtm
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.