0

I am trying to connect to the AX web services. What I will do it to fetch the right price given a product and a customer.

I realised the right webservice to use is PriceListServiceClient and I am able to log in to it using windows authentication, but I cannot retrieve any data from it.

Here is my code:

PriceListServiceClient priceListServiceClient = new PriceListServiceClient();



priceListServiceClient.ClientCredentials.Windows.ClientCredential.UserName = "yyy";

priceListServiceClient.ClientCredentials.Windows.ClientCredential.Password = "zzz!";

priceListServiceClient.ClientCredentials.Windows.ClientCredential.Domain = "xxx";

CriteriaElement[] criteriaElement = new CriteriaElement[1];

criteriaElement[0] = new CriteriaElement();

criteriaElement[0].DataSourceName = "SalesPrice";

criteriaElement[0].FieldName = "ItemId";

criteriaElement[0].Operator = Operator.NotEqual;

criteriaElement[0].Value1 = "5637153175";

QueryCriteria queryCriteria = new QueryCriteria();

queryCriteria.CriteriaElement = criteriaElement;

CallContext callContext = new CallContext();



var found = priceListServiceClient.find(callContext, queryCriteria);

Console.WriteLine(found.Currency);

priceListServiceClient.Close();

Any idea about why this is happening?

2 Answers 2

2

Try filling in the properties in the CallContext (company and language).

new CallContext { Company = "zzz", Language = "nl"  };
Sign up to request clarification or add additional context in comments.

1 Comment

I still get the same result
0

I found the answer here: http://community.dynamics.com/ax/f/33/p/118741/246784.aspx

The Ax class for Price List document is AxPriceDiscTmpPrintout Class. This class wraps the TmpPriceDiscPrintout table, which is a TMP table. That's why you are not getting anything in return.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.