web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Removing Usage Data (SysLastValue)

(0) ShareShare
ReportReport
Posted on by

One of the steps in my company's release process is to delete the entire contents of SysLastValue.  We had issues previously where a user had a personalization on a form where changes were made and those personalizations caused problems when the new code was deployed.  Since clearing the usage data worked to resolve the problem, it became a regular part of our deployment process.

Of course the users aren't too happy that every time we release an update, they lose all of their personalizations.  Now my company would like to take a more intelligent approach to this issue and drop the SysLastValue records only for objects that have been modified since the last release.  Is this possible?  When looking at rows in SysLastValue with a RecordType of UserSetup (29), there doesn't seem to be a good way to identify the parent object for which the change is being applied.  It appears to me that the ElementName column can refer to a form or any form control.  I can see the value column stores a container of nested containers and I can unpack that but I don't see anything in this container that tells me which form or object a particular user setup change belongs to.  

Is what I'm trying to do even a good idea?  If so, does anyone have guidance on how to identify what form a particular UserSetup record is referencing?  Any feedback that I can take to our DevOps and Management would be greatly appreciated!  Maybe there's a better way to handle this problem of potential issues around usage data and new released code?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ajit Profile Picture
    8,755 on at

    I think we should just delete the usage data not the personalization's, you can filter by using record type column.

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Is it possible that this issue is related to your system version? That is, do you run an older AX2012 version? If so, have you tried searching on LCS whether MS has fixed this or similar issues with a hotfix? I agree with you that users will be very unhappy if they lose all of their personalization and I would expect that there is a fix available on LCS. Please double check there.

    Best regards,

    Ludwig

  • Greg's Mom Profile Picture
    on at

    Thanks, Ajit.  Which record types do you recommend to delete and which ones do you recommend to keep?  I can see that the RecordType field is an instance of the UtilElementType enumeration which has about 100 elements.  I see the UtilElementType with a value of 29 is for UserSetup, are you suggesting the best approach is to delete all of the rows from SysLastValue with a RecordType of anything other than 29?  

  • Greg's Mom Profile Picture
    on at

    Thanks for the suggestion, Ludwig.  When this started, we were running AX 2012 CU7.  Since then, deleting the contents of SysLastValue has become a part of our deployment process.  By now we are upgraded to the latest version of AX 2012 R3 so potentially this issue has been resolved since then and we don't know it and we are deleting users usage data for no good reason.  The management team is nervous to remove this step of our deployment process because they fear we'll get a lot of help desk calls from our users with issues.  

    I checked LCS but I didn't find any fixes specific to this issue.  

    I can say, while doing form development, occasionally the form changes that I make don't reflect when I go to test the form and resetting my usage data will occasionally resolve this problem.  So as a developer, I'm often guilty of using this quick and dirty fix while I'm working on new forms.  I feel that this is an issue in the AX kernel and if there is some incompatibility between a user's usage data and the current form design (like if a field was removed from a form for which a user has usage data) then the system should be able to gracefully ignore those parts of the usage data and automatically purge them so they do not cause issues.  

  • Suggested answer
    Ajit Profile Picture
    8,755 on at

    You can try something like below -

    delete_from sysLastValue where (sysLastValue.recordtype != 9 || sysLastValue.recordType != 29) && sysLastValue.userId != '';

  • Greg's Mom Profile Picture
    on at

    We ended up going with the following code and deleting from SysLastValue with a RecordType of Form or UserSetup for the forms that were modified since our last release.  I've created a small temp table and for now, I populate it with the list of forms that have been modified since the last release and use an exists join to delete the usage data for any modified forms like this:

    delete_from sysLastValue
    where ((sysLastValue.RecordType == UtilElementType::Form) || (sysLastValue.RecordType == UtilElementType::Usersetup))
    && !sysLastValue.IsKernel
    exists join modifiedElements
    where modifiedElements.SysElementName == sysLastValue.elementName;

    I'm not completely satisfied with this resolution but it's at least a small improvement over what we had previously.

  • Ajit Profile Picture
    8,755 on at

    Brawndo - Please verify the answers if they were helpful.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans