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 :
Finance | Project Operations, Human Resources, ...
Answered

Hexadecimal value to Binary/Container (SysLastValue)

(0) ShareShare
ReportReport
Posted on by 30

Hello,

I need to move SysLastValue from one environment. to another.

Unfortunately, I can't move that via SQL, but I can read the source. It means, I can see a Hexadecimal value that is stored in DB.

The VALUE field that represents Container looks more or less like this:

"0x07FD0104000000011C00000001A606000001DE02000001D2000000017100000001FFFFFFFFFF"

How to transform this hex value in AX to be able to store that in SysLastValue.value field? 

I have the same question (0)
  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    Could you tell us more about your business requirement, please? Which object is this SysLastValue record related to? What you're trying to do may be logically impossible, depending on details of your situation.

    How did you get this hex string?

  • Damian Szymczak Profile Picture
    30 on at

    Hi Martin,

    Before I posted that I tried to find an answer in the internet and I read couple of your posts about Binary and BinData.

    Actually, I was hoping it would be you that could answer, because it looks like you are quite experienced in this area :)

     

    Details:

    I need to copy (from Test environment to Production) over 500 records of SysLastValue connected to specific user.

    I accidentally cleaned his profile and I need to restore it back.

    Luckily, we copied our DB (PROD->Test) this week, and the user is on vacation. Situation is not so bad :)

     

    His Usage Data contains:

    SysLastValue_2D00_missing2021_2D00_02_2D00_25_5F00_18_2D00_36_2D00_08.jpg

    I took Raw Hexadecimal Strings directly form Test DB via SSMS. 

     

    If there is a way for some transformation, I planned to import them from CSV.

    __

    Cheers!

  • Verified answer
    Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    Converting the string to Binary should be doable, but let's consider another approach. Let's say you create the records without Value. This will assign RecIds, therefore we won't have to worry about them. And then you'll use SQL code to update Value. Like this:

    UPDATE SysLastValue
    SET Value = 0x07FD0104000000011C00000001A606000001DE02000001D2000000017100000001FFFFFFFFFF
    WHERE ...

    As I understand, you can't connect to the database, but maybe you could execute SQL code from X (with Statement class).

  • Damian Szymczak Profile Picture
    30 on at

    Yes, it could be a good idea. I forgot about this way.

    I have full records (not only hex strings), with original RecIds, so I would try to even use INSERT in the SQL statement.

  • Damian Szymczak Profile Picture
    30 on at

    Hi Martin,

    It was a good idea. Sometimes a simplest way is the most optimal solution.

    The only thing that is maybe worth to mention here is RunOn property.

    SQL commands must be run on server, but of course AOS user couldn't read CSV file from my local folder. This is something for client. Those 2 functions should be separated then

  • Martin Dráb Profile Picture
    237,801 Most Valuable Professional on at

    When you need to read a file from a process running on AOS, the usual approach is putting it to a file share accessible from the server.

    Otherwise you would have to read the file on client, send the data to server (by calling a server-bound method) and then process the data there.

  • Damian Szymczak Profile Picture
    30 on at

    Yep, that's what I did.

    I read the file on client and sent it to server for further elaboration.

    Thanks for advices!

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans