Skip to main content
Solved

How to add a time field?


Hello all,

I have been trying to add a time field in acumatica. I know how to add a single field on detail level:
 

We have the option to add a date field but how shall I add only a time field?
Thanks in advance.

16 replies

Userlevel 7
Badge +19

Hi @Harshita  We should the DATETIME field only.  Below is the link for your reference and it will help.

 

https://riptutorial.com/acumatica/example/32320/the-pxdbtime-attribute

Userlevel 6
Badge +3

Hi @Harshita  We should the DATETIME field only.  Below is the link for your reference and it will help.

 

https://riptutorial.com/acumatica/example/32320/the-pxdbtime-attribute

where & how shall I these 2 in the customization project editor?

Userlevel 7
Badge +19

@Harshita Add DateTime field from the Project Editor and modify the DAC fields as shown in the above mentioned in the link.

Userlevel 6
Badge +3

@Harshita Add DateTime field from the Project Editor and modify the DAC fields as shown in the above mentioned in the link.

hey @Naveen Boga ,
I followed like this.

 

Userlevel 7
Badge +19

Hey  @Harshita  Seems usrTime field is duplicated in the POLineExt DAC. Can you please remove the duplicate and check once.

 

Userlevel 6
Badge +3

Hey  @Harshita  Seems usrTime field is duplicated in the POLineExt DAC. Can you please remove the duplicate and check once.

 

Hey @Naveen Boga , so I created a new field now as FieldName: UsrATime & Display Name : ATime DataType: datetime.

And copied the code from the above link & replaced usrTime & UsrTime to usrATime & UsrATime. Am I doing it correct?
 

#region UsrATime
public abstract class usrATime : IBqlField
{ }

[PXDBTime(DisplayMask = "t", InputMask = "t")]
[PXUIField(DisplayName = "Time Only Value")]
public DateTime? UsrATime { get; set; }
#endregion
Userlevel 7
Badge +19

Can you please share the customization package here?

Userlevel 6
Badge +3

Hey @Naveen Boga , attached here is the pkg.

Userlevel 6
Badge +3

hey @Naveen Boga , I tried to modify as below:
 

 

Userlevel 7
Badge +19

@Harshita  can you please publish the below package and add the field in the .aspx page?

 

Userlevel 6
Badge +3

Hey @Naveen Boga , thanks for helping out. I now tried to publish the customization. The field is working fine. I also added a checkbox field : eg Expedited. DataType - Bool. But it didnt result out to be checkbox on UI.
 

 

Userlevel 7
Badge +19

@Harshita  Please provide the Type = Checkbox in the .aspx page.

 

 

Userlevel 2
Badge

@Harshita  can you please publish the below package and add the field in the .aspx page?

 

Hi @Naveen Boga, What did you do to resolve this? I am also running into the same error CS0102 when replicating the example. 

Thanks!

Userlevel 7
Badge +19

@temberson  What is the issue that you are facing, can you please elaborate.

Userlevel 2
Badge

@Naveen Boga Thank you for the response, this was resolved. 

Userlevel 7
Badge +19

Great! Thanks for sharing the update.

Reply