0
我在我的代碼收到以下錯誤:接收錯誤在工作流活動代碼
條件屬性「sgfdhr_leavetype.new_employeeleavecalculation」:類型的期望的參數(S)「的System.Guid」但收到「Microsoft.Xrm .Sdk.EntityReference」。
我的代碼是下面:
public int Getleavetype(Entity LeaveManagement, IOrganizationService _orgService, CodeActivityContext Acontext)
{
QueryExpression GetLeavedetails = new QueryExpression();
GetLeavedetails.EntityName = "sgfdhr_leavetype";
GetLeavedetails.ColumnSet = new ColumnSet("new_type");
GetLeavedetails.ColumnSet = new ColumnSet("new_availabledays");
GetLeavedetails.Criteria.AddCondition("new_type", ConditionOperator.Equal, 1);
GetLeavedetails.Criteria.AddCondition("new_employeeleavecalculation", ConditionOperator.Equal,LeaveManagement["new_leavedetails"]);
EntityCollection LeaveDetails = _orgService.RetrieveMultiple(GetLeavedetails);
return (int)LeaveDetails[0]["new_availabledays"];
}
我上recieving錯誤 「EntityCollection LeaveDetails = _orgService.RetrieveMultiple(GetLeavedetails);」這行代碼如上。
感謝,