SPFx Web Part - Call Dynamics NAV Web Service




I've been playing around with trying to make a web part that will call a Dynamics NAV OData Service.  I followed the same process as I did when connecting Power BI to NAV.


I registered NAV in the Azure Management Portal as per: https://docs.microsoft.com/en-gb/dynamics-nav-app/ui-how-register-dynamics-nav-azure


I then tried to connect via my web part as per: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/connect-to-api-secured-with-...


In the Developer Tools pane when I add the web part to a page I get the following:

"Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource."


Within my package-solution.json file I make a request to grant user_impersonation permissions, which I did.  But as I'm typing I'm thinking that in the service tier for OData Services we use NavUserPassword Authentication, so is SharePoint trying to use my Office 365 login to access the data?


All of this has just been trial and error, so if anyone has done this before or has any pointers on something I could try next that would be great.  





0 Replies