Skip to main content
Solved

Profile Photo Uploader

  • November 4, 2024
  • 4 replies
  • 49 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!

View original
Did this topic help you find an answer to your question?

4 replies

Kandy Beatty
Captain II
Forum|alt.badge.img+16
  • Captain II
  • 2209 replies
  • 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+4
  • Captain II
  • 132 replies
  • 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
Kandy Beatty wrote:

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
MichaelShirk wrote:

@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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings