Announcements
Hi Experts,
I want to fetch the GUID of access team template using Plugin.
Any Help will be Appreciated.
Thanks in Advance
Regards,
Aman Anvaria
*This post is locked for comments
Hi Aman,
You can retrieve the teamtemplate (logical name for access template entity) using Query expression in C# plugin.
See: arunpotti.wordpress.com/.../retrieve-records-using-query-expression-c-sdk-in-crm
Hope this helps.
You can open the window where you have created the team and open the "console" (using F12)
You can in the "console" tab write the following: "window.location.href".
When doing so you will get an url like: "<root>/main.aspx?etc=92&extraqs=%3fetc%3d92%26id%3d%257bB3228218-B8F6-4A1B-A18D-552C6F980831%257d&histKey=777420436&newWindow=true&pagetype=entityrecord#108249740"
If you check the url, you can see the Guid in here. It starts after the following characters "257b". Therefore the Guid in my case would be: "B3228218-B8F6-4A1B-A18D-552C6F980831".
Hi Aman,
You can also try with query expression- Below is the code . Hope this helps.
- ConditionExpression condition = new ConditionExpression();
- condition.AttributeName = "teamtemplatename";
- condition.Operator = ConditionOperator.Equal;
- condition.Values.Add("Template Name need here");
- FilterExpression filter = new FilterExpression();
- filter.Conditions.Add(condition);
- QueryExpression query = new QueryExpression("teamtemplate");
- query.Criteria.AddFilter(filter);
- query.ColumnSet = new ColumnSet("teamtemplateid"); // You can add additional column as well here
- EntityCollection accessTeamColl = service.RetrieveMultiple(query); // Need to get the Org service proxy
- foreach (var templateent in accessTeamColl.Entities)
- {
- string Id = ((templateent.Contains("teamtemplateid")) ? (templateent["teamtemplateid"] as EntityReference).Id.ToString() : "");
- }
Hi,
Team template schema name
team template guid
Use FetchXML to construct a query
https://msdn.microsoft.com/en-us/library/gg328117.aspx
Sample
<fetch count="50" >
<entity name="teamtemplate" >
<attribute name="description" />
<attribute name="teamtemplateid" />
</entity>
</fetch>
André Arnaud de Cal...
293,729
Super User 2025 Season 1
Martin Dráb
232,718
Most Valuable Professional
nmaenpaa
101,158
Moderator