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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to read Company Specific data via AIF

(0) ShareShare
ReportReport
Posted on by 989

Hi Expert ,

  I want to read Company Specific data from Dynamics AX 2009 . But i can't see any parameter where we can pass SenderId (CompanyName) . Below is the example read company specific data from Dynamics AX 2012 R2 : 

 

<Start AX 2012> 

ServiceReference5.CallContext context = new ServiceReference5.CallContext();
context.Company = "dat";
ServiceReference5.EcoResProductServiceClient axCustomerServiceClient = new ServiceReference5.EcoResProductServiceClient();

ServiceReference5.EntityKey customerEntityKey = new ServiceReference5.EntityKey();
customerEntityKey.KeyData = keyFieldList.ToArray();

List<ServiceReference5.EntityKey> customerEntityKeyList = new List<ServiceReference5.EntityKey>();
customerEntityKeyList.Add(customerEntityKey);

var readCustomer = axCustomerServiceClient.read(context, customerEntityKeyList.ToArray());

<End AX 2012>

 

Below is AX 2009 Code :

ServiceReference2009_ItemService.ItemServiceClient axCustomerServiceClient = new ServiceReference2009_ItemService.ItemServiceClient();
ServiceReference2009_ItemService.CriteriaElement ce = new ServiceReference2009_ItemService.CriteriaElement();

ce.FieldName = "ItemId";
ce.Operator = ServiceReference2009_ItemService.Operator.Equal;
ce.Value1 = txtReadValue.Text;


ServiceReference2009_ItemService.QueryCriteria axOrderQueryCriteria = new ServiceReference2009_ItemService.QueryCriteria();

axOrderQueryCriteria.CriteriaElement = new ServiceReference2009_ItemService.CriteriaElement[1] { ce };
var readCustomer = axCustomerServiceClient.find(axOrderQueryCriteria);

 

 Please suggest how to pass SenderId(Company) when i read data from AX 2009 using Service ?

 

Thanks

Surajit Kundu

 

 

 

 

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    The documentation mentions that the target company could be changed via the System.ServiceModel.Channels MessageHeader:

    msdn.microsoft.com/.../cc652581(v=ax.50).aspx

    Alternatively you could use different local AIF endpoints for different companies, or you could follow Martin's advice here:

    https://dynamicsuser.net/ax/f/technical/72743/create-dataareaid-via-aif-service-in-ax-2009

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi surajitkundu,

    Please refer next blog post blogs.msdn.microsoft.com/.../switching-companiesendpoints-when-calling-aif-services

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 39

#2
Michel ROY Profile Picture

Michel ROY 14

#3
imran ul haq Profile Picture

imran ul haq 8

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans