NAV 2013 MD5 Hash generator

Marijn
Member Posts: 69
Hello,
The goold old Navision Attain Hash 1.0.HashCalculator automation does not seem to work in NAV 2013. In 2009 and earlier NAV versions it works fine. But in 2013, when compiling the object, it throws an error: You cannot create an Automation Hash on Microsoft Dynamics NAV Server. You must create it on a client computer.
This message puzzles me and I have no idea how I would generate a hash in NAV 2013. If someonse can point me in the right direction I would be very grateful.
The goold old Navision Attain Hash 1.0.HashCalculator automation does not seem to work in NAV 2013. In 2009 and earlier NAV versions it works fine. But in 2013, when compiling the object, it throws an error: You cannot create an Automation Hash on Microsoft Dynamics NAV Server. You must create it on a client computer.
This message puzzles me and I have no idea how I would generate a hash in NAV 2013. If someonse can point me in the right direction I would be very grateful.
0
Comments
-
Use the 2nd parameter of the CREATE() function - pass TRUE and this will create the automation object on the client PC instead of the service tier server.0
-
Thank you for your answer.
NAV 2013 does not let me save the codeunit. Compiling using F11 does not throw an error, but saving is not allowed for some reason. I am trying something like this:
CREATE(Hash, FALSE, FALSE);
HashString := Hash.CalculateMD5(InputString);
CLEAR(Hash);
EXIT(HashString);
(Hash: Navision Attain Hash 1.0.HashCalculator)
According to the documentation, the ClientSide boolean would be the third parameter, but I tried all combinations of TRUE and FALSE for the second and third parameters but NAV never allows saving the object. It makes me wonder whether this automation can still be used in 2013. It seems odd that something like generating a text string needs to be done clientside.0 -
Ok. Creating a hash now works in NAV 2013. Not sure where I messed up though.
CREATE(Hash, TRUE, TRUE);
HashString := Hash.CalculateMD5(String);
CLEAR(Hash);
EXIT(HashString);0 -
Yes, should be third parameter - didn't have NAV in front of me and my memory is not what it used to be ;-)0
-
BTW: you should stop using automation and start using .NET. NAV2013 servicetier has some problems with 32-bit automation because it is a 64-bit application.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Does anybody know if there is a dot net assembly availible that I can use?0
-
Use 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.System.Web.Security.FormsAuthentication
MESSAGE(MD5.HashPasswordForStoringInConfigFile('a','MD5'));
No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Thanks a lot!0
-
Hi,
I would also recommend this one as you can create MD5 hash for a file or a BLOB field.Name DataType Subtype Length MD5 DotNet System.Security.Cryptography.MD5.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' BTcon DotNet System.BitConverter.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' SInStream InStream HashKey Text 50 GetMD5Hash(SEntry : Record "S Entry") : Text[50] SEntry.CALCFIELDS(SBLOB); IF SEntry.SBLOB.HASVALUE THEN BEGIN SEntry.SBLOB.CREATEINSTREAM(SInStream); MD5:=MD5.Create(); MD5.ComputeHash(SInStream); HashKey:= BTcon.ToString(MD5.ComputeHash(SInStream)); HashKey:=DELCHR(HashKey, '=', '-'); EXIT(HashKey); END ELSE EXIT('');
I hope this helps someone.
Thanks.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions