Add Field to Report?

I am trying to simply add a field to the SalesInvoiceReport. I added the field to the SalesInvoiceTMP table. However, when I edit the report object, the data source is not bringing in the field that I added to the table. How do I get it to show up?

Did you drag and drop the new field to the report ?

Regards,

Raghav

Hi Neil,

once again add Table to that Report or Restore the report…it will take that added field…

Thanks,

SureSh

Hi,

It is quite common in AX ,due to synchronization problem.U just go to your table where u added new field and right click and synchronize.now go to your report open data source that field should be there.now you can add in the report design .after that save it and restore it.it will work.

Hi,

it has very little to do with table synchronization. I do believe that you have saved the tmp table and double checked in AOT that the field is there.

Open the report in Visual Studio:

  1. right-click on the datasource and do “Referesh”. Did the new field appear in datasources’s field list?

  2. If it did not appear, right-click again choose “Edit…”, click then “Next” and check if your field appears in the list. If it does, mark the checkbox so that the field can be used in report.

  3. If still after clicking edit you don’t see the field, go back to AX and do at least incremental CIL. Reopen Visual Studio and do steps 1 or 2 again.

  4. If still after all those steps the field is not there, then it means that your Visual Studio has been started with a wrong AX configuration. Unfortunately Microsoft has made the AX integration a bit awkward - the AOT which you see on the left comes from one configuration (from parameter with which you start the Visual Studio or simply your default AX config on that machine). However the query list (where you choose the datasource for the report and where Visual Studio gets info about AX datastructure) comes from another configuration which is stored in system registry…

Janis.

Thanks for the help.It looks like you were correct in that it is pulling the data from the PROD environment instead of the TEST environment. This seems ridiculous to me. How are developers supposed to switch between environments in Visual Studio? Also, we current have all of our environments on one machine (that will be changing in a few weeks when we get a new server in). Not sure if that will help or not.

How do you recommend that I switch between environments? Going into the registry each time does not seem like a good solution. Is there a place in the report object to specify which environment to point to?

Hi Neil,

I am glad that you spotted the problem I pointed to. Yeah, I would say that this is a bug from Microsoft, although it has been acknowledged quite a long time ago and as far as I know it hasn’t been fixed yet.

What we did for this reason - we have created a .BAT file (command line file) and a .REG file (registry entry file) for every environment from which Visual Studio can be opened in the proper environment (it means that both - AOT and data structure windows pull data from one single environment and not from some random environment). Those runnable .BAT files look like this (at first it writes proper values in registry and then runs Visual Studio with a correct AX config parameter):

@echo OFF
regedit.exe /s “M:\WHATEVER\DEV_System.reg”
cd “c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE”
“C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe” /AxConfig “M:\WHATEVER\DEV_System.axc”
EXIT

And the .REG file which is being referenced in this .BAT, has content like this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Dynamics\6.0\Configuration]
“ConfigurationFile”=“M:\WHATEVER\DEV_System.axc”

So, create a pair of both .BAT and .REG per each environment, set the right pathes to files and VOILA… This will do the magic and ensure that you open the right environment every time.

Janis

Thanks again for all of the help. I will look into getting this set up.