web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

creating customer x++

(3) ShareShare
ReportReport
Posted on by 230
Hi,
 
If we have an external system that stores customers with their own account number (they don't store D365 account number) and this customer can exist in some of legal entities in d365.
so we'll store their external account number in d365 using a customized field

now If we need to create those customers in specific legal entities through integration

So they will send us:
CustAccount1, create/update in both USMF and USRT


So in d365, we need to to look for their custAccount1 in the external customized field, if we found it, then it means it's an update, and we need to update the customer in both legal entities. If we didn't find it, then it means we need to create that customer in two legal entities. (i know depending on the external ref is not accurate but that's what we have)

what is best way to do it?

A) Should we let the integration call odata first to check if the external ref exists (GET) and store d365 customerAccountNum, if found, then call odata again to update (PATCH) in two legal entites for the d365 accountNum, and if not found call odata (post) to insert in the two legal entities? (batch call: url/data/$batch)
like this
--batch_1
Content-Type: multipart/mixed; boundary="changeset_1"

--changeset_1
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 1

POST CustomersV3?cross-company=true&$filter=dataAreaId eq 'UMSF' HTTP/1.1
Content-Type: application/json; type=entry

{ 
    "dataAreaId": "UMSF", 
    "customerAccount": "xx-1";
	...etc
} 

--changeset_1
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 2

POST CustomersV3?cross-company=true&$filter=dataAreaId eq 'USRT' HTTP/1.1
Content-Type: application/json; type=entry

{ 
    "dataAreaId": "USRT", 
    "customerAccount": "xx-1";
	...etc
} 



--changeset_1--

--batch_1--


B) or is it better to use custom service?

where the input can be list of vendors with list of legal entities? and we do the lookup for external ref inside the service?
{
  "_vendors":
  [
    {
      "externalRef": "CustAccount1",
      "dataAreaIds":
      [
        {
          "dataAreaId": "USMF"
        },
        {
          "dataAreaId": "USRT"
        }
      ]
    },
    {
      "externalRef": "CustAccount2",
      "dataAreaIds":
      [
        {
          "dataAreaId": "USMF"
        }
      ]
    }
  ]
}


**the volume for integration should be low -- and we might need to also create customer postal address and customer contact persons, which means if we go with odata, we'll need to do different two calls to different data entities to create postal address and contact persons.
While for custom service we can do all of that in one place but not sure about performance. using odata might mean more hits to DB but short time. While doing custom service maybe the time will be more as everything in one place, but still hits to db will be the same right?
Categories:
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    305,703 Super User 2026 Season 1 on at
    HI,
     
    This is a great question, but needs more input to recommend the best option. Using OData, you can group the calls in a batch, but I thought that each post action has its own transaction scope. When you are using a service, you can do all within one database transaction scope.
     
    You mentioned multiple contact persons. Are these provided in a single source/one trigger? Or is there a trigger per contact person from your other system?
  • CU22120935-0 Profile Picture
    230 on at
    Hi Andre,

    In odata batch, they are all under the same changeset (changeset_1), so if one fails the other one will also fail

    regarding contactPersons, the middle ware will pull data from the external system each hour and pass them to d365, so it could be one contactPerson when pulled or multiple.

    hope that gives enough info to decide best way.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 628 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 501 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 437

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans