Skip to main content

Notifications

Announcements

No record found.

Copy personalisation, including favorites and filters from one user to multiple

You probably have bumped into this situation where you or one of the key-users customized extensively several forms, created a list of favorites and several complex filters in Dynamics AX 365. 

Question is: how to copy in one go from user x to user y without going through the pain of copying record by record - that's unfortunately one of the only options available. It is time consuming and cumbersome to say the least.

Bear in mind this is just a suggestion and obviously open to any corrections/remarks. I thought sharing our own experience to help you. It worked with us and saved us a lot of time. 

Here's what you need:

- A developer

- Tables: FormRunConfiguration, 

FormRunConfigurationProperty 

FormRunConfigurationOptions (optional), 

sysMenuNavigationFavoriteItemsTable (optional), 

SysLastValue

1. Create a basic main() class. If you have access to AX2012, create a job and then copy it to D365 and change the Job name to main() and you have it. An experienced developer will understand this.

2. Inside the class, create a simple dialog with fields like "From User" (original user), "To User" (destination user). We also add the options "Replace and Update" for future use (don't worry about this now, we are just replacing).

3. Call method Delete to clear the tables mentioned above based on destination User, field User or UserId.

4. Start reading the table FormRunConfiguration based on original User (Loop Start)

5. Copy record and insert into FormRunConfiguration based on destination User, meaning change original user to destination user after copying the record.

6. Now the important part:

  • Based on original user record, read  FormRunConfigurationProperty where formRunConfigurationProperty.Configuration == formRunConfiguration.RecId
  • Prepare record to insert for the destination user by copying all data from formRunConfigurationProperty but change  formRunConfigurationProperty (destination).Configuration = formRunConfiguration (destination).RecId --> this is the record you just inserted in FomrRunConfiguration table for the destination user.
  • insert new record in FormRunConfigurationProperty 

7. Read the next FormRunConfiguration record based on original user. (Loop end)

8. Create loops, copy/past, change only the User/UserId where necessary for the other tables: FormRunConfigurationOptions (optional), SysMenuNavigationFavoriteItemsTable (optional), SysLastValueSysLastValue is mandatory if you want to copy the favorites and the filters. The others are optional.

9. Create a menu entry to call this class.

That's basically it. Good luck.

I will try to answer any questions, just don't ask me to send you the source code :-)

Comments

*This post is locked for comments