这是一个很长的机会,但这是.
我目前正在进行一个通过XRMServices与Microsoft 2011接口的项目。
我的问题是,某些货币(即货币)值会在AccountBase表中更新,而其他的则不会更新。收入字段将更新,但aging30值不会更新。这两个字段具有相同的主要属性:
尽管字段可能是只读的,但究竟是什么导致了这种情况呢?我认为我可能与字段级安全或用户安全有关,但似乎并非如此。我对系统拥有足够的权限,并且字段属性没有设置为禁用此类操作。我唯一能想到的另一件事是,它可能是一个工作流,禁止我更新这个值,但我再次看不到系统中似乎与这一点相关的任何东西。运行该实体下面的代码后,将更新收入值,并且在dbo.AccountBase中可见,但aging30字段不可见。XRM服务不会产生任何异常。
图1-检索帐户
public Entity GetByAccountCode(string accountCode, bool allColumns = false)
{
if (string.IsNullOrEmpty(accountCode))
return default(Entity);
QueryExpression query = new QueryExpression("account");
query.ColumnSet = new ColumnSet(allColumns);
query.Criteria = new FilterExpression();
query.Criteria.AddCondition("accountnumber", ConditionOperator.Equal, accountCode);
EntityCollection results = _service.RetrieveMultiple(query);
if (results.Entities.Count == 0)
return default(Entity);
if (results.Entities.Count > 1)
throw new DuplicateRecordsOnAccountCodeException(accountCode, "Duplicate records on AccountCode found"); // needs to be changed appropriatly
return results[0] as Entity;
}图2-更新帐户**
account.Attributes["revenue"] = new Money((decimal)100m); // This value is updated
account.Attributes["aging30"] = new Money((decimal)200m); // This value is not
_service.Update(entity);发布于 2014-05-20 13:07:25
基于SDK,该字段(aging30)是一个平台,仅适用于读取。
https://stackoverflow.com/questions/23760225
复制相似问题