Hi Experts
I am new to crm
I have a team entity that is linked the equipment entity (equipment entity are a lookup field to the team), then under the team i have a calendar linked to it.
Team > Equipment (TeamLookup)> Calendar
I have written a QueryExpression to retrive the calendarID linked to the equipment below
Guid TeamId = this.inputTeam.Get(executionContext).Id;
QueryExpression query = new QueryExpression("team") { ColumnSet = new ColumnSet("teamid") };
LinkEntity linkedEquipment = query.AddLink("equipment", "teamid", "new_team");
LinkEntity linkedCalender = linkedEquipment.AddLink("calendar", "calendarid", "calendarid");
query.Criteria.AddCondition("pro_team", ConditionOperator.Equal, TeamId);
EntityCollection results = service.RetrieveMultiple(query);
if (results.Entities.Count > 0)
{
Entity Resource = results.Entities[0];
currentResourceId = Resource.GetAttributeValue<Guid>("calendarid");
}
return currentResourceId;
}
However the below doesn't return an calendarID I get new_Team field doesnot exits on the Team Entity error
*This post is locked for comments