Monday, February 10, 2014

Project Hour Sales Price by Project Contract or Customer Account is Not Implemented

During an AX 4.0 to AX 2012 R2 upgrade, I came across an issue with the Project Hour Sales Price functionality.

This functionality had been implemented in AX 4.0 and AX 2009, removed for AX 2012, and then added back in AX 2012 R2 CU6.

In the Project Hours Sales Price form, you're able to specify pricing based on a variety of criteria as seen in the image below.


Prior to the 2012 R2 CU6 release, the Project contract ID and Customer account fields, both in AX 4.0 and 2009, were not available. With the 2012 R2 CU6 release, these fields were reintroduced to the form. However, the code behind the form for selecting pricing records was not updated appropriately.

The Hours Journal and Project Timesheet forms both call a method, findHourSalesPrice, in the ProjHourSalesPrice table. When we review this method, we see a few interesting things.


  1. The code in the findHourSalesPrice method makes no reference to Project contract ID or Customer account. Sections in the method where we would expect to see a Project contract ID or Customer account are replaced with blank strings.
  2. There is PSA specific code (from 4.0/2009) that is used to determine pricing by Project contract ID and Customer account. However, this code is never called from the Hours Journal or Project Timesheet forms. The code relies on the Price group, Customer account, or Project contract ID being passed from the Hours Journal or Project Timesheet form.
  3. Price searching is performed differently between the findHourSalesPrice and psaFindHourSalesPrice methods and differently in the psaFindHourSalesPrice based on the valid for value provided.

    Method: findHourSalesPrice
    Method: psaFindHourSalesPrice
    Valid For: Table
    Valid For: Group
    Valid For: All
    Project ID + Worker + Category

    Project ID + Worker

    Project ID + Category

    Project ID
    Project ID + Worker + Category

    Project ID + Worker

    Project ID + Category

    Project ID

    Project contract ID

    Customer account

    Category + Worker

    Worker

    Category
    Worker + Category

    Worker

    Category
    Worker + Category

    Worker

    Category


Microsoft has identified this as being an issue and will address it in a future hotfix.