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)

C# Application to get an item price for a specific customer

(0) ShareShare
ReportReport
Posted on by

Hello,

I need to write a very basic C# application that simply makes a web service call to Dynamics and passes in the customer account and one or more item IDs and have it return the final price (after trade agreements, etc).

Can anyone point me in the right place to start?  Seems like this would be a common Dynamics integration need, but I cannot find many examples.

Thanks in advance for any direction! 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Please check the following discussion threads and hope it could provide you some pointers.

    i. Invoking AX web service via C# - to fetch the right price for a given product and customer

     (community.dynamics.com/.../118741)

    ii. (Invoking AX web service via C#)

    stackoverflow.com/.../invoking-ax-web-service-via-c-sharp

  • Community Member Profile Picture
    on at

    Thanks for the reply, Chaitanya . I have implemented this. It works technically, but it returns no results (code below). Any ideas why? Is this definitively the correct service to call for what I am trying to accomplish?

    Thank you in advance. -Dan


    /////////////////////////////////////////////////////////////////////////////

    PriceListClient.PriceListServiceClient priceListServiceClient = new PriceListClient.PriceListServiceClient();

    priceListServiceClient.ClientCredentials.Windows.ClientCredential.UserName = "my_un";
    priceListServiceClient.ClientCredentials.Windows.ClientCredential.Password = "my_pw";
    priceListServiceClient.ClientCredentials.Windows.ClientCredential.Domain = "my_domain";


    PriceListClient.CriteriaElement[] criteriaElement = new PriceListClient.CriteriaElement[2];


    criteriaElement[0] = new PriceListClient.CriteriaElement();
    criteriaElement[0].DataSourceName = "SalesPrice";
    criteriaElement[0].FieldName = "ItemId";
    criteriaElement[0].Operator = PriceListClient.Operator.Equal;
    criteriaElement[0].Value1 = "1234";

    criteriaElement[1] = new PriceListClient.CriteriaElement();
    criteriaElement[1].DataSourceName = "SalesPrice";
    criteriaElement[1].FieldName = "CustAccount";
    criteriaElement[1].Operator = PriceListClient.Operator.Equal;
    criteriaElement[1].Value1 = "1000";


    PriceListClient.QueryCriteria queryCriteria = new PriceListClient.QueryCriteria();
    queryCriteria.CriteriaElement = criteriaElement;

    PriceListClient.CallContext callContext = new PriceListClient.CallContext();

    var found = priceListServiceClient.find(callContext, queryCriteria);
    Console.WriteLine(found.SalesPrice);
    priceListServiceClient.Close();

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