I was trying to use the plugin exampleQuery Related Records Tooland find out a bug. At least I think so.With feature layer http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSPetro/MapServer/1this code wan't work
// Get the name of the ObjectID field.
objectID = relatesLayer.LayerInfo.ObjectIdField;
// get key value
Object v = inputFeature.Attributes[objectID]; // v is empty
but this code work just fine
// Get the name of the ObjectID field.
objectID = relatesLayer.LayerInfo.ObjectIdField;
string objectIDAlias = getFieldAlias(relatesLayer, objectID);
if(objectIDAlias != "") objectID = objectIDAlias; // because of bug? in Graphic.Attributes[fieldname];
// get key value
Object v = inputFeature.Attributes[objectID]; // v have id value
Because of feature layer has objectid field alias 'Object ID' and Attributes object give access to values by field alias.I think, Attributes object must give access to values by field names.