From following snippet I am adding Display Name as key and Logical name as value to a dictionary. In first iteration of loop it runs successfully but in second iteration it throws exception that Object reference not set to an instance of an object.. Don't know about such weired behavior of this property. any suggestion
Dictionary<string, string> attrData = new Dictionary<string, string>(); RetrieveAllEntitiesRequest metaDataReq = new RetrieveAllEntitiesRequest(); RetrieveAllEntitiesResponse metaDataRes = new RetrieveAllEntitiesResponse(); metaDataReq.EntityFilters = EntityFilters.Entity; metaDataRes = (RetrieveAllEntitiesResponse)service.Execute(metaDataReq); EntityMetadata[] emData = metaDataRes.EntityMetadata; if (emData.Length <= 0) { return; } string temp = string.Empty; //key, value for (int item = 0; item < emData.Length; item++) { attrData.Add(Convert.ToString(emData[item].DisplayName.UserLocalizedLabel.Label), emData[item].LogicalName); }
*This post is locked for comments