Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

custom service dataArea

(1) ShareShare
ReportReport
Posted on by 1,233
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 230,371 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
    .. 1,233 on at
    custom service dataArea
    Hi,
     
    Any help?
  • .. Profile Picture
    .. 1,233 on at
    custom service dataArea
    Hi Waed,

    Thanks but this doesn't answer my questions.
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,493 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
     

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans