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)

Hooking into the account code priority of PriceDiscAgreements

(0) ShareShare
ReportReport
Posted on by 300

I have an external application where I am reporting customer prices from Dynamics Ax 2012 R2

I know that if a customer has multiple agreements but with different account codes then the order of priority is TABLE, GROUP, ALL. There are a couple of things I was wondering...

1. To pick the right price do I ...

a. Just need to compare the item relation and the account code, and take the highest priority. 

b. Or do I need to look for agreements where all columns are identical except for the account code.

2. I am aware I am duplicating functionality in an external .net application. Is there anyway to hook into Dynamics Ax functionality for this and pull a results set so I'm not developing and maintaining duplicate functionality.

Many thanks in advance for all your feedback.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi!

    Did you get customer price's data from AX DB directly?

    To pick the right price for customer you should check:

    1. If priority is TABLE - ItemRelation, AccountCode (customer code), DateFrom and DateTo.

    2. If priority is GROUP - ItemRelation, AccountCode (customer group code), DateFrom and DateTo.

    3. If priority is ALL - ItemRelation, DateFrom and DateTo.

  • Yohann Rolland Axcible Profile Picture
    3,111 on at

    Hi,

    You should also pay attention to the find next option. This will have a real impact on the correct price.

    You can have a look in here.

    http://d365tour.com/en/microsoft-dynamics-d365o/trade-logistics-d365fo-en/find-next/

  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi richierich79,
    There is PricePriceListService AIF service out of the box, try it. That's a guide how to consume AIF services https://docs.microsoft.com/en-us/dynamicsax-2012/appuser-itpro/consuming-microsoft-dynamics-ax-services-from-an-external-client  if you are not familiar with them. It's quite easy and you dont need to reinvent the wheel.

  • richierich79 Profile Picture
    300 on at

    Hi Rustem

    Thank you for your response. Yes I am getting the price from the DB correctly.

    I think my first knowledge gap is to do with the "customer group code". I was under the impression that when account code was Group it mean that the AccountRelation linked to the GroupId in dbo.PriceDiscGroupTable. Is this not the case?

    I am trying to create a report of price changes for products to customers. Is there any relation between a customer and a discount group or are discount groups just for items?

  • richierich79 Profile Picture
    300 on at

    Thanks Yohann

    I am only dealing with Price agreements. My understanding is...

    Find Next ticked = Will get the best price independent of the account code

    Find Next not ticked = Will get a price in order of the following priority of existing agreements for that item- TABLE, GROUP, then ALL

    Do you think this understanding is accurate?

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    This is price agreement journal's lines in AX:

    Screen-Shot-2018_2D00_09_2D00_07-at-21.42.18.png

    and this is the same from SQL DB

    Screen-Shot-2018_2D00_09_2D00_07-at-21.42.18.png

    If AccountCode's value is Table then AccountRelation must be filled by customer account code.

    If AccountCode's value is Group then AccountRelation must be filled by GroupId from PriceDiscGroup table and the price will be for customers with this GroupId:

    Screen-Shot-2018_2D00_09_2D00_07-at-21.49.11.png

    And if AccountCode's value is All then AccountRelation fields must be empty.

    Search priority will be:

    1. Table

    2. Group

    3. All

  • richierich79 Profile Picture
    300 on at

    Rustem

    Many thanks for this, it has confirmed my understanding on using account code.

    The only issue I have is where you say "for customers with this GroupId"

    Where is the relationship between the customer and the [dbo].[PRICEDISCGROUP] table?

    I know that a customer can be part of a customer group (GroupId in dbo].[CUSTTABLE]) but it's my understanding  dbo.CUSTGROUP is completely separate to [dbo].[PRICEDISCGROUP] and no relationship exists?

    If you could help clarify I would be most grateful

  • Mea_ Profile Picture
    60,286 on at

    Why do you need to know this ? There is out of the box service that can return you list of prices. This serves could be consumed from any .Net application.

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    The [dbo].[CustTable].[PriceGroup] field contain information about price group.

    5460.Screen-Shot-2018_2D00_09_2D00_07-at-21.49.11.png

  • richierich79 Profile Picture
    300 on at

    Hi ievgen

    Thanks for your response, and it may very well be closest to answering the original question and in the long term I may end up using it for extra confidence on accuracy.

    My application updates prices and I already have well developed stored procedures to manage pricediscagreements and so should only need tweeking to get clients prices. For just retrieving prices I originally hadn't used to AIF web service as I needed more complicated relationships in the data so went directly to the DB. I do use the AIF web service to update the prices though.

    My concerns over using the service to report customer prices would be...

    Performance

    Whether it will give me all the data I require.

    How the web services differ between different versions, or if they are even present on other versions (This is developed for 2012R2 but I would want it useable for other versions)

    In your opinion are these concerns valid or not?

    Thanks for your feedback.

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 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans