Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / custom service dataArea
Finance forum
Suggested answer

custom service dataArea

Posted on by 977
Hi,

1. When creating custom services, do we need to put legalEntity as an input to the service (contract class)? then use changeCompany()?

2. Because when calling the custom service via C#, i know that DataAreaId can be specified by callContext and without even adding legal entity as an input to the service or using change company(). What is call context here and how does it specify the dataAreaId in the background?
CallContext callContext = new CallContext { Company = "USMF" };
sessionInfo = ((ABCService)channel).getDetails(new getDetails(callContext,request1));

3. But if i will call the custom service via postman as json, then how i'm going to specify the legal entity without having the dataArea as an input and without using changeCompany function?
 
4. In conclusion, is it needed? if yes then when and why?
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 228,177 Most Valuable Professional on at
    custom service dataArea
    What you actually mean by saying "when calling the custom service via C#" is that you're using the SOAP endpoint. Which language you use (if any at all) is irrelevant and you also can use the JSON-based endpoint from C#, but there is no CallContext in such a case. As far as I know, you need to add the company to the contract if you're using the JSON-based endpoint.
  • .. Profile Picture
    .. 977 on at
    custom service dataArea
    Hi,
     
    Any help?
  • .. Profile Picture
    .. 977 on at
    custom service dataArea
    Hi Waed,

    Thanks but this doesn't answer my questions.
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 5,197 Super User 2024 Season 2 on at
    custom service dataArea
    Hi,
     
    It depends on your case, in general the legal entity is determined based on the user that is used on the integration, but if you want to add the data to another legal entity then you should add dataarea Id as parameter in the contract class.

    Also check the following link it maybe helps you:
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,339 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,177 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans