I am new to Microsoft Dynamics. I need to build a feature into a Microsoft Dynamics 365 On-Premises form that allows users to:
- Select files to upload via an “upload files” button
- Send those selected files to a remote MS SQL Server database (i.e. not the Dynamics database)
The first part seems like straightforward HTML and JavaScript:
<h3>Select files to upload:</h3>
<input type=“file” itemId=“myFiles” multiple />
<p>Choose files to upload and then click “Send” to send the files to the remote DB.</p>
<button onclick=“uploadButtonClick()”>Upload</button>
<script>
function uploadButtonClick(){
// Gather file names, then prepare for SQL Server upload magic
}
</script>
The second part is where I am stuck because I don’t know how to pass the upload file names to server-side code and then send those files to the remote SQL Server database. I can write the C# myself outside of Dynamics in a separate .NET C# project, but am unaware of how it is done via best practice in Dynamics 365. A custom Plug-in? WebAPI? Something else?
Is there a tried-and-true approach for doing the above in Dynamics 365?