Old cache files may cause AX 2012 Real Time Service to fail

Recently one of my colleagues ran into a strange issue. When performing some actions on the POS that involved calling AX 2012 via Real Time Service, the call failed. In another environment with the same code base, the code succeeded. Also, the RTS failure happened only on certain calls, other calls against the same server worked correctly (the specific case: retrieving a previous sales order succeeded, but sending a completed return order to AX failed).

The event log on the RTS machine was quite confusing: the error message was “Cannot create a record in System parameters (SystemParameters). The record already exists.” But there was nothing wrong with the system parameters.

I captured the request from the POS to the RTS and wrote a small job in AX to call the respective class/method directly using the same request and this worked fine. Even more confusing.

The solution came after realising that the Real Time Service uses .NET Business Connector to connect to the AOS. From the architectural perspective, the Business Connector is like a regular AX client without a user interface. Recently the AX environment in question had been updated with new code – but the same code worked fine on another machine. Earlier I had seen weird issues on a regular AX client where the solution was to get rid of the user cache files. And this turned out to be the solution for the RTS too. Continue reading

Adding fields to a Dynamics AX Retail “pull” distribution sub job

Whilst the process for adding a field to a channel database and have it populated by AX via the CDX synch engine when data is sent to the channel database is relatively straightforward, the steps required for a “pull” sub job are somewhat longer. Missing some of these steps can lead to a number of outcomes including the synch failing or the data for the extra fields simply not being populated in AX.

To save some of the pain of trying to remember everything that you need to do, here’s a short crib sheet for the steps required. I’m going to use the example of adding a field to the RetailTransactionTable table but this could easily be any of the RetailTransaction* tables. These steps only cover the AX head office changes and not what you need to do to add the fields into the channel database itself (we will cover that in another post some time soon).

  1. Add the field to the RetailTransactionTable table in the AOT
  2. Add the field to the RetailTransactionTableX table in the AOT (missing this step will cause an error to be thrown when data is synchronised for this table).
  3. Modify the RetailTransactionTableX::insertToRegularTable() method, inserting the new field into the two field lists that make up the insert_recordset operation in the method (missing this step will not cause an error to be thrown but the value of your new field will not be persisted to the AX database during the synchronise).
  4. For AX 2012 FPK & 2012 R2 (missing these steps will mean that the new field will not be included in the sub job transfer field list for the table)…
    1. Modify the RetailConnSeedDataGenerator.setDRMLocationDesignTableField_01() method to include the new field (if you’re modifying a different table then you will need to find the correct setDRMLocationDesignTableField* method for your table).
    2. Modify the RetailConnSeedDataGenerator.subjobFields_RBOTransactionTable() method to include the new field (if you’re modifying a different table then you will need to find the correct subjobFields* method for your table).
  5. For AX 2012 R3 (missing this step will mean that the new field will not be included in the sub job transfer field list for the table)…
    1. Modify the RetailCDXSeedData_AX63.C_RetailTransactionTable method to include the new field (if you’re modifying a different table then you will need to find the correct C_* method for your table).
  6. Compile & build the IL (missing this step will mean that the new field will not be included in the sub job transfer field list for the table)
  7. Click the Retail Parameters –> Initialise button to configure the synch engine with your new field (missing this step will mean that the new field will not be included in the sub job transfer field list for the table)

I’ve previously written about the differences between the original RetailConnSeedDataGenerator class and the set of classes that perform the same function in Dynamics AX 2012 R3. You can find that post here.

Changing label text on the POS

Sometimes you’ll want to customise the text that appears on the POS forms to meet the needs of the client.

Did you know that each string of text that appears on a POS form has a unique label ID?  Well, by finding out the POS label ID it is possible to centrally override the standard POS text linked to that ID and apply the text you want to display instead.

This is how you do it…

1.  Change the POS shortcut target = ‘-tr’

Change the target

Change the target

2.  Now open the POS using the amended shortcut.  Every label on the POS will now display a unique label ID.

2

3.  Identify the text on the POS that you want to change and make a note of the POS label ID – in this case lets change label 110 which currently says “Search or enter quantity”

4.  Login to Dynamics AX

5.  Access the AOT > Tables – find the table named ‘RetailLanguageText’ and select open

5

6.  This table contains a list of POS override text.  Any text linked to labels here will override the standard POS labels.

6

7.  Create a new row in the table and specify:

  • The language ID
  • The replacement label text
  • And in Text ID ensure this is the label number – e.g. 110
  • Tick the Active checkbox

8.  In this example I have changed the text for label 110 to be “Enter SKU or product name”.

9.  Now you will need to synchronise this label update down to the POS.  To do this run the Registers job under Retail > Periodic > Data Distribution – Distribution Schedule.  The actual sub job that applies the change is ‘ADDP-PLT’ which updates the RetailLanguageText table on the POS Database.

7

10.  Logon to the POS.  You should see that the relevant POS label has now been changed.

8

11.  Don’t forget to remove –tr from your POS shortcut so that the label ID’s stop showing

If this didn’t work – ensure you entered the label language ID in AX correctly for the User who is logging onto the POS.