how to compare password field with Text field?

181deepak
Member Posts: 95
Hi experts
I have a Password field (data type = text ) (The extended property of filed is Masked that's why I called is a password field), and one more Text field (Data type = text), (Both are customized fields),
but when I try to compare these fields
like
IF PasswordField = Rec.TextField THEN
BEGIN
//DO SOMETHING. LIKE PASSWORD MATCH
END
ELSE
BEGIN
// DO SOMETHING LIKE PASSWORD DON'T MATCH.
END;
BUT ALWAYS ELSE PART IS RUNNING EVEN TWO FIELDS HAVE SAME VALUE.
PLEASE SUGGEST SOLUTION//
I have a Password field (data type = text ) (The extended property of filed is Masked that's why I called is a password field), and one more Text field (Data type = text), (Both are customized fields),
but when I try to compare these fields
like
IF PasswordField = Rec.TextField THEN
BEGIN
//DO SOMETHING. LIKE PASSWORD MATCH
END
ELSE
BEGIN
// DO SOMETHING LIKE PASSWORD DON'T MATCH.
END;
BUT ALWAYS ELSE PART IS RUNNING EVEN TWO FIELDS HAVE SAME VALUE.
PLEASE SUGGEST SOLUTION//
0
Comments
-
Have you debugged the code? What you see as values in the two variables: PasswordField and Rec.TextField ? The problem is not in the compare part, but I think somewhere before it, in part where you are readin/filling these two values...0
-
Thanks for reply,
yes i did, i think the password field is encrypted and when i compare it with other text field it does't match,
is there any way to decrypt is before match or any other suggestion.0 -
you need to apply same decrypt function to your password and compare the result.0
-
what is that function?0
-
If you only set the ExtendedDataType property the field is NOT encrypted. It is not shown in the user interface, but the value can still be read. So I do not see any problem with your code, it has to be the data. Text fields normally strip whitespaces at the begin and end of the value, so that could be a difference. Also try to re-type the password in the password field.0
-
181deepak wrote:what is that function?
If you are talking about the password in User Property table in NAV 2013, nobody knows... the password is set through SETUSERPASSWORD function which do that...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