Пример #1
0
        public static Entity ReplicateWithFields(Entity entity, IEnumerable <string> fieldsToSubmit)
        {
            var submissionEntity = new Entity(entity.LogicalName)
            {
                Id = entity.Id
            };

            if (fieldsToSubmit != null)
            {
                foreach (var field in fieldsToSubmit)
                {
                    if (entity.Contains(field))
                    {
                        XrmEntity.SetField(submissionEntity, field, XrmEntity.GetField(entity, field));
                    }
                }
            }
            return(submissionEntity);
        }
Пример #2
0
 public object LookupField(string entityType, Guid id, string fieldName)
 {
     return(XrmEntity.GetField(Retrieve(entityType, id, new[] { fieldName }), fieldName));
 }