Select to view content in your preferred language

How to get LastModifiedDate of feature layer through Javascript api

1460
5
Jump to solution
06-15-2017 07:29 PM
KamalMittal
Deactivated User

Hi,

I want to get LastModifiedDate or Last Edit Date of feature layer through javascript api v3.2. How do I achieve that?

Thanks,

Kamal

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Kamal,

   For that you would use esriRequest to get the json result for the rest endpoint that you are picturing in your image.

require([
  "esri/request", ... 
], function(esriRequest, ... ) {
  var layerUrl = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0";
  var layersRequest = esriRequest({
    url: layerUrl,
    content: { f: "json" },
    handleAs: "json",
    callbackParamName: "callback"
  });
  layersRequest.then(
    function(response) {
      console.log("Success: ", response);
  }, function(error) {
      console.log("Error: ", error.message);
  });
  ...
});

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Emeritus

Kamal,

   Are you saying that your feature layer has a field for LastModifiedDate or Last Edit Date?

0 Kudos
KamalMittal
Deactivated User

Please see attachment below

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Kamal,

   For that you would use esriRequest to get the json result for the rest endpoint that you are picturing in your image.

require([
  "esri/request", ... 
], function(esriRequest, ... ) {
  var layerUrl = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0";
  var layersRequest = esriRequest({
    url: layerUrl,
    content: { f: "json" },
    handleAs: "json",
    callbackParamName: "callback"
  });
  layersRequest.then(
    function(response) {
      console.log("Success: ", response);
  }, function(error) {
      console.log("Error: ", error.message);
  });
  ...
});
KamalMittal
Deactivated User

Thanks Robert. It works like a charm.

Can I achieve same thing through arcgis runtime iOS sdk v100.0 ?. I have put query related to this to new thread:

https://community.esri.com/message/694399-how-to-get-lastmodifieddate-of-feature-layer-through-ios-s... 

Thanks,

Kamal

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Kamal,

   Be sure to mark this question as answered. I don't know runtime stuff so some one there will have to answer that.

0 Kudos