我在我的代码中收到以下错误:
属性“sgfdhr_leavetype.new_employeeleavecalculation”的条件:预期参数类型为“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"];
}
我收到关于“EntityCollection LeaveDetails = _orgService.RetrieveMultiple(GetLeavedetails);”的错误 上面代码中的这一行。
谢谢,