我有一个问题:创建新记录时出现错误...`
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Expected non-empty Guid.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147220989</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Expected non-empty Guid.</Message>
<Timestamp>2013-01-31T09:23:30.4406111Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>
代码...` 将字段设置为值。我也试过
Pline.Id = new Guid();
Pline.Id = a; //(a is a guid ref to parent record)
Entity Pline = new Entity("bc_packlines");
if (b.Attributes.ContainsKey("mins_sum"))
{
BlockMins = ((Decimal)((AliasedValue)b["mins_sum"]).Value);
}
Pline.Attributes["bc_packlinesid"] = Pline.Id;
Pline.Attributes["bc_pack"] = a;
Pline.Attributes["bc_type"] = "948110004";
Pline.Attributes["bc_minutespurchased"] = BlockMins;
Pline.Id = a;
service.Create(Pline);
请问有什么想法吗?谢谢