This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public string Create(string entityLogicalName, object data) | |
| { | |
| string result = string.Empty; | |
| string apiBaseUrl = $"{_d365Url}/api/data/v9.1"; | |
| string apiFullUrl = $"{apiBaseUrl}/{entityLogicalName}s"; | |
| using (HttpClient httpClient = new HttpClient()) | |
| { | |
| httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _accessToken); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections.Generic; | |
| using System.Net.Http; | |
| using System.Net.Http.Headers; | |
| namespace MediumD365.ConnectWebAPI | |
| { | |
| public class QuerySamples | |
| { | |
| #region | Private Definitions | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public string RetrieveAuthToken(string authorityURI, string d365Url, string clientId, string clientSecret) | |
| { | |
| string result = string.Empty; | |
| using (HttpClient httpClient = new HttpClient()) | |
| { | |
| string tokenUrl = $"{authorityURI}/oauth2/token"; | |
| HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, tokenUrl); | |
| request.Content = new FormUrlEncodedContent(new[] { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public string RetrieveAuthToken(string authorityURI, string d365Url, string clientId, string clientSecret) | |
| { | |
| string result = string.Empty; | |
| ClientCredential clientCredential = new ClientCredential(clientId, clientSecret); | |
| AuthenticationContext authenticationContext = new AuthenticationContext(authorityURI, false); | |
| var authenticationResult = authenticationContext.AcquireTokenAsync(d365Url, clientCredential).GetAwaiter().GetResult(); | |
| result = authenticationResult.AccessToken; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CrmSvcUtil.exe | |
| /url:https://<organizationUrlName>.api.crm4.dynamics.com/XRMServices/2011/Organization.svc | |
| /out:<outputFilename>.cs | |
| /username:<username> | |
| /password:<password> | |
| /namespace:<outputNamespace> | |
| /serviceContextName:<serviceContextName> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Parametre | Kısayol | Gerekli mi? | Açıklama | |
|---|---|---|---|---|
| url | E | OrganizationService URL bilgisi | ||
| out | o | E | Kodun adı (CrmData.cs gibi) | |
| domain | d | H | Sunucuya bağlanmak için gerekli olan domain bilgisi | |
| username | u | E | Sunucuya bağlanmak için gerekli olan kullanıcı adı bilgisi. Dynamics 365 Online için zorunludur. | |
| password | p | E | Sunucuya bağlanmak için gerekli olan parola bilgisi. Dynamics 365 Online için zorunludur. | |
| namespace | n | H | Kod için Namespace bilgisi. Default olarak global namespace kullanılır. | |
| language | l | H | Kodun dil bilgisi (C# yada VB). Default olarak 'CS' | |
| servicecontextname | H | Oluşturulan OrganizationServiceContext 'in adı. Eğer isim belirtilmezse ServiceContext oluşturulmaz. | ||
| generateActions | H | Action 'lar için Request ve Response yapılarını oluşturur |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isUnifiedInterface() { | |
| var globalContext = Xrm.Utility.getGlobalContext(); | |
| var applicationUrl = globalContext.getCurrentAppUrl(); | |
| var clientUrl = globalContext.getClientUrl(); | |
| if (applicationUrl !== clientUrl) { | |
| return true; | |
| } | |
| return false; | |
| } |
NewerOlder