Encrypting a Field

SbhatSbhat Member Posts: 301
edited 2003-12-04 in Navision Attain
Hi Folks,

I need to encrypt a field. For example i enter a credit card no. 1234-4445-3444-4444. As soon as the user leaves the field, i would like to have the field encrypted xxxx-xxxx-xxxx-4444. But the value in the table should be 1234-4445-3444-4444. Is this doable? Any help is highly appreciated.

Thanks
Best regards
Suresh.

Comments

  • andre_nandre_n Member Posts: 12
    What about linking a textbox to a variable, which then writes to the table and replaces the original value with ****?
    andre
  • Timo_LässerTimo_Lässer Member Posts: 481
    There are two possible ways:
    1. Set the property "Password text" of the field to "Yes", then the field has the same behaviour as any password field.
      But you didn't see the real content when you type in. :cry:
    2. Let the field be a "normal" text field.
      On each form which displays the field you use the OnFormat Trigger of your "Credit Card" field and do anything with the value what you want :wink:
      But do it only with the parameter "Text" of the Trigger :!:
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • nicklaslnicklasl Member Posts: 10
    Don't forget to disable the Zoom, Ctrl-F8...
  • Timo_LässerTimo_Lässer Member Posts: 481
    nicklasl wrote:
    Don't forget to disable the Zoom, Ctrl-F8...
    You are right!
    If you use the way over the OnFormat Trigger you must disable the Zoom because the OnFormat Trigger only works on the control not in the Zoom.
    But if you use the way over the Password Text you didn't see anything (when you type in the Number / when the value is shown in the field / when the User opens the Zoom).
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • BobBretonBobBreton Member Posts: 7
    Basicly if the field is empty show the Input box that
    is connected to the Database table, once you enter
    a value in this field we transfer its contents to
    the text box and make the CCNumber (DB Field) invisible.


    CCNumber - OnFormat(VAR Text : Text[1024];)
    IF NOT (CCNumber = '') THEN
    BEGIN
    CurrForm.CCNumber.VISIBLE := FALSE;
    CurrForm.BlankCC.VISIBLE :=TRUE;
    END;


    Form - OnAfterGetRecord()
    BlankCC := COPYSTR(CCNumber,1,4);


    Form - OnNewRecord(BelowxRec : Boolean)
    IF CCNumber = '' THEN
    BEGIN
    CurrForm.CCNumber.VISIBLE := TRUE;
    BlankCC := '';
    CurrForm.BlankCC.VISIBLE := FALSE;
    END;

    Variables
    Name DataType Subtype Length

    BlankCC Code 10


    Controls

    1 TextBox (Used to store 4 digits)
    1 Label (Used to Identify Credit Card Number box)
    1 Field (CCNumber)
    RKB
Sign In or Register to comment.