adrake

Hard-code Attribute Values for Fields with AttributeInspector?

Discussion created by adrake on Jun 13, 2012
Latest reply on Jun 14, 2012 by adrake
Hi,

I am trying to hard code values for some fields I am accessing in the Attribute Inspector.  Essentially, I would like to set a GIS_Editor and GIS_Edited_Date field(s) equal to the current user (logged in via a asp LoginName).

I am not real sure where this would be done.  I have a section in my code that I tried to do this, but it didn't work.  Am I even looking in the right place?

Here is my test code:

 dojo.connect(attInspector, "onAttributeChange", function (feature, fieldName, newFieldValue) {
        //store the updates to apply when the save button is clicked 
        updateFeature.attributes[fieldName] = newFieldValue;
        updateFeature.attributes["GIS_Editor"] = dojo.byId('LoginName').innerHTML;
        updateFeature.attributes["GIS_Edited_Date"] = dojo.byId('ServerTime').innerHTML;
  });

Outcomes