Announcements
Hi all,
I'm working on an integration for Dynamics 365 for Sales with our system, and I'm trying to figure out a couple of things.
One thing that I would like to be able to do is to add a custom field to a lead where I could save our systems' ID so that we can cross match it later as that lead is processed. I've found a lot of documentation about custom leads, but all of them are how to create them through the UI, I wasn't able to find any information about how to do it through the Web API.
What would be the correct way to create a custom field on an entity (Lead) through the API? Can I use the access token that I have with CRM scope, or do I need to use some other Apps?
Thanks!
Hello,
It is possible to create custom columns using the API. Check this post - docs.microsoft.com/.../create-update-entity-definitions-using-web-api
Is there a way to create the field in the Lead Table through the API instead of going through the interface as you describe? I'm working on a multitenant App, and I would like to be able to create a new "external_id" field for a lead without the interaction from the user (after they have done the login and I have a valid access token on their behalf)
Hi,
Thank you for your query.
As far as I understood, you need to add a custom field to store the ID of an external system.
You do not need to create the field via API, you need to update this field using API.
Here is the high-level solution:
Create a table row using the Web API (Microsoft Dataverse) - Power Apps | Microsoft Docs
You can set the new field in the Payload:
POST [Organization URI]/api/data/v9.0/leads HTTP/1.1 Content-Type: application/json; charset=utf-8 OData-MaxVersion: 4.0 OData-Version: 4.0 Accept: application/json { "subject": "New Lead", "fullname": John Doe, "new_externalid":"LEAD-XYZ-00910" }
You can also update using web-api:
Update and delete table rows using the Web API (Microsoft Dataverse) - Power Apps | Microsoft Docs
Create a custom field:
Create and edit fields with Dynamics 365 Customer Engagement (on-premises) | Microsoft Docs
André Arnaud de Cal...
293,302
Super User 2025 Season 1
Martin Dráb
232,114
Most Valuable Professional
nmaenpaa
101,156
Moderator