I think a found a bug or two with QueryAttachmentInfos. Is anyone else using this and seeing similar behavior?I've been using the code below to get attachements, if present, for graphics returned from IdentifyResults -
flyr.Initialized += (s, e) =>
{
string title2 = t2;
Graphic feat = f2;
FeatureLayer fl = s as FeatureLayer;
FeatureLayerInfo fli = fl.LayerInfo;
if (fli.ObjectIdField != null)
{
urlFeature = urlLayer + "/" + feat.Attributes[fli.ObjectIdField];
}
else
{
urlFeature = urlLayer + "/" + Guid.NewGuid().ToString();
}
_dataItems.Add(new DataItem() { Title = title2, Data = feat.Attributes, Id = urlFeature });
_dataLinks.Add(urlFeature, new List<DataLink>());
cbxIdentify.ItemsSource = _dataItems;
if (fli.HasAttachments)
{
fl.QueryAttachmentInfos(feat, FLayer_QryAttachmentsComplete, FLayer_QryAttachmentsFail);
}
};
It works great until I joined a table to a layer in the mxd and republished the service. Now I get the following error on fl.QueryAttachmentInfos -System.ArgumentOutOfRangeException was unhandled by user code Message=Specified argument was out of the range of valid values.Parameter name: Invalid graphic or ObjectID StackTrace: at ESRI.ArcGIS.Client.FeatureLayer.QueryAttachmentInfos(Graphic g, Action`1 callback, Action`1 errorCallback)....The other overload for QueryAttachmentInfos takes the feature's OID as the input instead of a graphic, but when I try using feat.Attributes[fli.ObjectIdField] it's null. fli.ObjectIdField is coming back as the fully qualified field name but in the graphic, the attributes are not qualified. Is this by design or another error?Thanks,Terry