Personalized Community is here!
Quickly customize your community to find the content you seek.
Check out the latest Sales updates!Learn about the key capabilities and features of Dynamics 365 Sales and experience some of the new features.
Download overview guide | Watch Sales video
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
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?
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
"subject": "New Lead",
"fullname": John Doe,
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
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)
It is possible to create custom columns using the API. Check this post - docs.microsoft.com/.../create-update-entity-definitions-using-web-api
Business Applications communities