Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

Integrate with Microsoft Dynamics CRM API using ASP.NET Core

(0) ShareShare
ReportReport
Posted on by 8
hellow all :
 
Iam biggner developer in company and they ask me to build app in asp.net to print purchase order from d365 finOps  so ,
 
1- register app in AAD.
my program by GPT chat help 
// in appsettings.json file {  /DynamicsCRM/: {    /BaseUrl/: https://your-crm-instance.api.crm.dynamics.com/api/data/v9.0//,    /ClientId/: /your-client-id/,    /ClientSecret/: /your-client-secret/,    /TenantId/: /your-tenant-id/  }}// in DynamicsCRMService.cs file using System.Net.Http;using System.Net.Http.Headers;using System.Threading.Tasks;using Microsoft.Extensions.Configuration;using Newtonsoft.Json;public class DynamicsCRMService{    private readonly HttpClient _httpClient;    public DynamicsCRMService(IConfiguration configuration, HttpClient httpClient)    {        _httpClient = httpClient;        var dynamicsCRMConfig = configuration.GetSection(/DynamicsCRM/);        _httpClient.BaseAddress = new System.Uri(dynamicsCRMConfig[/BaseUrl/]);        _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(/application/json/));    }    public async Task<string> GetPurchaseOrders()    {        var response = await _httpClient.GetAsync(/purchaseorders/);        response.EnsureSuccessStatusCode();        return await response.Content.ReadAsStringAsync();    }}//in program file builder.Services.AddHttpClient<DynamicsCRMService>();builder.Services.AddScoped<DynamicsCRMService>();// DynamicsCRMService controller using Microsoft.AspNetCore.Mvc;using System.Threading.Tasks;[ApiController][Route(/[controller]/)]public class PurchaseOrderController : ControllerBase{    private readonly DynamicsCRMService _dynamicsCRMService;    public PurchaseOrderController(DynamicsCRMService dynamicsCRMService)    {        _dynamicsCRMService = dynamicsCRMService;    }    [HttpGet]    public async Task<IActionResult> GetPurchaseOrders()    {        var purchaseOrders = await _dynamicsCRMService.GetPurchaseOrders();        return Ok(purchaseOrders);    }}
there is no error but not any result in https://localhost:5001/purchaseorder
  • Komi Siabi Profile Picture
    Komi Siabi 12,759 Most Valuable Professional on at
    Integrate with Microsoft Dynamics CRM API using ASP.NET Core
    Hi,
     
    You want to be able to print an Invoice report from a PO. 
     
    Is this PO created in D365 FinOps or from CRM?
     
  • Integrate with Microsoft Dynamics CRM API using ASP.NET Core
     
    is there function to print PO as invoice report . they need to print as invoice to contract department .
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,234 Super User 2025 Season 1 on at
    Integrate with Microsoft Dynamics CRM API using ASP.NET Core
    Hi,
     
    I don't know if the coding generated by Chat GPT is reliable. As you are using a CRM API, I can't help you. My experience is mainly with Finance and Operations (both technical is functional). I have some functional knowledge of CRM, but not on the technical programming side. Still I wonder how purchase order details from FinOps would be needed to be retrieved with a CRM API.
  • Integrate with Microsoft Dynamics CRM API using ASP.NET Core
    thanks mr.andre 
    I think it is not available to them in d365 because they use manual way by excel sheet (import data from d365 by OData and make some queries to print purchase order) this way take long time, So they ask me to build app to get data from d365 and print in specific format.
    Now my ask is the program, right? why don’t run with me?
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,234 Super User 2025 Season 1 on at
    Integrate with Microsoft Dynamics CRM API using ASP.NET Core
    Hi Community user,
     
    Your question confuses me. You talk about a CRM API, Dynamics 365 FinOps and some coding generated by GPT.
    In case you would need to print a purchase order from Dynamics 365 Finance and Operations, you can use this application. What is the exact business issue you are asked to solve? Why a separate ASP.NET application and what is the relation with CRM?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,234 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,994 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans