How to create an account with a primary contact with JavaScript in Dynamics 365

How to create a record in Dynamics 365 using Xrm.WebApi.