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)
--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?

Report
All responses (
Answers (