Solved

Hide password in data field at Custom Screen


Userlevel 4
Badge +2

Hi,

In this topic 

The sample custom screen and endpoint was provided by @jinin for my solution, which contains custom screen with user and password for input  in Acumatica interface 

So, I have custom form with fields

I need password value to be hidden same as at login tab

What actions at customization screen must be done for that ?

Acumatica version 2021R2

thanks in advance

 

icon

Best answer by Naveen Boga 6 July 2022, 17:47

View original

12 replies

Userlevel 6
Badge +3

hi @Ivan ,

You can use [PXRSACryptStringAttribute(255, IsUnicode = true)]  at DAC level,this will encrypt the password.

Sample for your reference.

        [PXUIField(DisplayName = "FTP Password")]
        [PXDefault()]      
        [PXRSACryptStringAttribute(255, IsUnicode = true)]
        public virtual string FTPPassword { get; set; }
        public abstract class fTPPassword : BqlString.Field<fTPPassword> { }

Userlevel 4
Badge +2

hi @Ivan ,

You can use [PXRSACryptStringAttribute(255, IsUnicode = true)]  at DAC level,this will encrypt the password.

Sample for your reference.

        [PXUIField(DisplayName = "FTP Password")]
        [PXDefault()]      
        [PXRSACryptStringAttribute(255, IsUnicode = true)]
        public virtual string FTPPassword { get; set; }
        public abstract class fTPPassword : BqlString.Field<fTPPassword> { }

Hi @praveenpo 

Thank you for provided info

I will check and let you know

Userlevel 4
Badge +2

hi @Ivan ,

You can use [PXRSACryptStringAttribute(255, IsUnicode = true)]  at DAC level,this will encrypt the password.

Sample for your reference.

        [PXUIField(DisplayName = "FTP Password")]
        [PXDefault()]      
        [PXRSACryptStringAttribute(255, IsUnicode = true)]
        public virtual string FTPPassword { get; set; }
        public abstract class fTPPassword : BqlString.Field<fTPPassword> { }

@praveenpo 

It behaves strange

At the very beginning it has hidden value, but I have not inputted nothing at the very begging

After I inputted value

 

 

After I inputted value, the encryption disappeared 

That is my code 

 

Userlevel 6
Badge +3

@Ivan ,

Please provide TextMode="Password" in aspx.

 <px:PXTextEdit ID="edFTPPassWord" runat="server" DataField="FTPPassWord" TextMode="Password" />

Userlevel 4
Badge +2

@Ivan,

Please provide TextMode="Password" in aspx.

 <px:PXTextEdit ID="edFTPPassWord" runat="server" DataField="FTPPassWord" TextMode="Password" />

@praveenpo 

I am attaching password in aspx due to your request

<px:PXTextEdit ID="edPassword" runat="server" AlreadyLocalized="False" DataField="Password" CommitChanges="true"></px:PXTextEdit>

Userlevel 4
Badge +2

 @praveenpo 

I added TextMode="Password"  in aspx

the problem remains same as I described above 

Userlevel 7
Badge +17

Hi @Ivan  It should work with the below code at the DAC level and make sure Commit Changes = “True” at the page level. It seems there is some issue with your code.

 

 [PXRSACryptString(IsUnicode = true, InputMask = "")]

 

Userlevel 4
Badge +2

Hi @Ivan  It should work with the below code at the DAC level and make sure Commit Changes = “True” at the page level. It seems there is some issue with your code.

 

 [PXRSACryptString(IsUnicode = true, InputMask = "")]

 

Hi @Naveen Boga 

Thank you for your reply

I checked Commit Changes property according to your advise

And inserted your code 

Unfortunately it did not help 

I have stars depiction before I have inputted something while I just opened the page

 

Userlevel 7
Badge +17

Hi @Ivan  There is nothing wrong with the above code, it should work.

For some reason, it is not working in your instance.

You can try in the other instance and verify this.

Userlevel 4
Badge +2

Hi @Ivan  There is nothing wrong with the above code, it should work.

For some reason, it is not working in your instance.

You can try in the other instance and verify this.

I understood

One more question - Is ok that before password textblock a star symbol appeared

It looks like it general view problem 

Userlevel 7
Badge +17

@Ivan  I’m assuming that the above one is the configuration screen.

In your DAC field, since you have provided the PXDefault(), then the system will consider that field as mandatory, hence asterisk (*) symbol appeared on the screen.

If you don’t want that field as mandatory, you can remove the PXDefault for the DAC field.

 

[PXUIField(DisplayName = "FTP Password")]       

[PXDefault()]             

[PXRSACryptStringAttribute(255, IsUnicode = true)]       

public virtual string FTPPassword { get; set; }

public abstract class fTPPassword : BqlString.Field<fTPPassword> { }

Userlevel 4
Badge +2

@Ivan  I’m assuming that the above one is the configuration screen.

In your DAC field, since you have provided the PXDefault(), then the system will consider that field as mandatory, hence asterisk (*) symbol appeared on the screen.

If you don’t want that field as mandatory, you can remove the PXDefault for the DAC field.

 

[PXUIField(DisplayName = "FTP Password")]       

[PXDefault()]             

[PXRSACryptStringAttribute(255, IsUnicode = true)]       

public virtual string FTPPassword { get; set; }

public abstract class fTPPassword : BqlString.Field<fTPPassword> { }

@Naveen Boga  thank you for provided answers

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved