Total Pageviews

Search This Blog

Friday, October 30, 2009

Tip: How to export/import from SysLastValue table

Recently, I was troubleshooting an issue related to user settings. i.e. There was a requirement to migrate the user settings from one environment to another.

As we all know, User related setups for queries, forms, reports etc are stored in SysLastValue table. This is a system table and can't be accessed directly through AOT.

Solution:

NOTE: PLEASE BACK UP YOUR SYSLASTVALUE TABLE BEFORE YOU ATTEMPT THE BELOW STEPS AND TRY TO VALIDATE THE STEPS FIRST IN A TEST/SANDBOX ENVIRONMENT

1. Created a definition Group for SysLastValue table






2. Filter only for SysLastValue table






3. Set up the filter criteria For export in our case we have to do for one user















4. Note that at this point when we do the export, the .dat and .def file which is generated won't be having any data in it. This is becoz by default the System tables are not included in the Standard Export/Import Wizard of AX.

We need to do a small code change inorder to achieve this, Go to AOT > Classes > SysDataExpImp





















5. Modify the candoTable method inorder to comment out the code which does the system table check for SysLastValue as shown below














6. Now, once again do the export and there you go..

Initially, I tried to do the SQL way, but figured out that it doesn't work and moreover SQL is not the correct way as we can miss out on Recids.

4 comments:

AQL said...

Nice post!
I tried to follow your instructions and I exported with no problem... but I have not been able to import it. I always receive the "0 records imported" message.
Do I need to change something to import?

Thanks in advance.
António

Dilip said...

Hi Antonio,

Please check if you have selected the proper company from where you need to export and also do verify once again the steps especially commenting the code shown in my post.

Thanks,
Dilip

Kevin said...

In AX 2009, I am trying to export a user's SalesTable form setup using this tip. In the filter criteria for export, I specified the UserId, RecordType = UserSetup, and Name = "SalesTable". In the resulting .dat file, I see nothing in the Value field (blob?) and I am assuming this contains the setup information. Will this work without the value field?

Thanks,
Kevin

Gexton said...

We are producing 100% cotton yarn of several counts ranging from 10/s up to 40/s for knitting and weaving.
cotton yarn from Pakistan
cotton carded yarn exporter in Pakistan