Skip to main content
Answer

Profile Photo Uploader

  • November 4, 2024
  • 4 replies
  • 82 views

Forum|alt.badge.img

How can I implement a profile photo uploader to upload an image and display that image on the Employee screen?

Best answer by MichaelShirk

@tharinduweerasooriya90  Hey!

We implemented this on the Ship Via Codes in our instance, but you could do the same thing on the employees screen.

You may need to do this in a code, because I’m not sure the project editor supports this type of field as a Low-Code No-Code customization. Your VAR, or a contract developer like @darylbowman could help you with this.

Or you can attempt it yourself.
Here is the DAC code and the ASPX Code. Note that this is in the database as a “string” type field, but is defined as a “PXImageUploader” type in the aspx.

        #region UsrEmployeeImgUrl
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Employee Image URL")]
public string UsrEmployeeImgUrl { get; set; }
public abstract class usrEmployeeImgUrl : PX.Data.BQL.BqlString.Field<usrEmployeeImgUrl> { }
#endregion

 

<px:PXImageUploader runat="server" ID="imgUploaderUsrEmployeeImgUrl" DataField="UsrEmployeeImgUrl" AllowUpload="true" ShowComment="true" DataMember="CurrentEmployee" Height="320px" Width="430px" />

Below is the resulting UI element. 

 

Hope this helps!

4 replies

Kandy Beatty
Captain II
Forum|alt.badge.img+17
  • Captain II
  • November 4, 2024

Hi @tharinduweerasooriya90 

What screen exactly are you trying to do this with? Can you provide more detail please?


MichaelShirk
Captain II
Forum|alt.badge.img+5
  • Captain II
  • Answer
  • November 4, 2024

@tharinduweerasooriya90  Hey!

We implemented this on the Ship Via Codes in our instance, but you could do the same thing on the employees screen.

You may need to do this in a code, because I’m not sure the project editor supports this type of field as a Low-Code No-Code customization. Your VAR, or a contract developer like @darylbowman could help you with this.

Or you can attempt it yourself.
Here is the DAC code and the ASPX Code. Note that this is in the database as a “string” type field, but is defined as a “PXImageUploader” type in the aspx.

        #region UsrEmployeeImgUrl
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Employee Image URL")]
public string UsrEmployeeImgUrl { get; set; }
public abstract class usrEmployeeImgUrl : PX.Data.BQL.BqlString.Field<usrEmployeeImgUrl> { }
#endregion

 

<px:PXImageUploader runat="server" ID="imgUploaderUsrEmployeeImgUrl" DataField="UsrEmployeeImgUrl" AllowUpload="true" ShowComment="true" DataMember="CurrentEmployee" Height="320px" Width="430px" />

Below is the resulting UI element. 

 

Hope this helps!


Forum|alt.badge.img

Hi @tharinduweerasooriya90 

What screen exactly are you trying to do this with? Can you provide more detail please?

Employee Screen (EP203000)


Forum|alt.badge.img

@tharinduweerasooriya90  Hey!

We implemented this on the Ship Via Codes in our instance, but you could do the same thing on the employees screen.

You may need to do this in a code, because I’m not sure the project editor supports this type of field as a Low-Code No-Code customization. Your VAR, or a contract developer like @darylbowman could help you with this.

Or you can attempt it yourself.
Here is the DAC code and the ASPX Code. Note that this is in the database as a “string” type field, but is defined as a “PXImageUploader” type in the aspx.

        #region UsrEmployeeImgUrl
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Employee Image URL")]
public string UsrEmployeeImgUrl { get; set; }
public abstract class usrEmployeeImgUrl : PX.Data.BQL.BqlString.Field<usrEmployeeImgUrl> { }
#endregion

 

<px:PXImageUploader runat="server" ID="imgUploaderUsrEmployeeImgUrl" DataField="UsrEmployeeImgUrl" AllowUpload="true" ShowComment="true" DataMember="CurrentEmployee" Height="320px" Width="430px" />

Below is the resulting UI element. 

 

Hope this helps!

Thanks for your help