Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

C# console app calling javascript function or html page

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

1. I have a C# console app that retrieves records from CRM entities.

2. I have an external html page that uses JavaScript to send data to another website since the website only support json. 

Now I need to somehow pass the record data from the C# console app to a script or html page so I can send those data out.

Does anyone know how this can be done? or can I use JavaScript on my html page to retrieve record data directly from CRM?

Thank you!

*This post is locked for comments

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: C# console app calling javascript function or html page

    Since it seems like your web site is external to CRM, I think that maybe the better choice would be either create your own Web Api or Web Services that will get the data that you need from CRM, and provide it to you in JSON format so that you can use it from your HTML/JavaScript code.

    The Console Application would be able to provide you the data and possibly export it to a file that you can read from, but that would not be dynamic/on-demand. The data would only be populated when you run the Console application.

    If you don't have where to create the web api or service, you can host them on Azure (for almost nothing).

    Hope this helps.

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: C# console app calling javascript function or html page

    I would suggest you use javascript/webAPI from your html page and retrieve data from CRM. that would be easy and reliable.

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…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans