Skip to main content
Solved

How to add a time field?

  • Jul 4, 2024 12:39 PM UTC
  • 16 replies
  • 449 views
  • Translate All

Forum|alt.badge.img+3

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.

Best answer by Naveen Boga

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

 

View original

16 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jul 4, 2024 2:29 PM UTC

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

Translate

Forum|alt.badge.img+3
  • Author
  • Captain II
  • Jul 4, 2024 2:37 PM UTC

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?

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jul 4, 2024 2:48 PM UTC

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

Translate

Forum|alt.badge.img+3
  • Author
  • Captain II
  • Jul 4, 2024 4:45 PM UTC

@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.

 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jul 4, 2024 4:55 PM UTC

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

 

Translate

Forum|alt.badge.img+3
  • Author
  • Captain II
  • Jul 4, 2024 5:00 PM UTC

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
Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jul 4, 2024 5:04 PM UTC

Can you please share the customization package here?

Translate

Forum|alt.badge.img+3
  • Author
  • Captain II
  • Jul 4, 2024 5:06 PM UTC

Hey @Naveen Boga , attached here is the pkg.

Translate

Forum|alt.badge.img+3
  • Author
  • Captain II
  • Jul 4, 2024 5:13 PM UTC

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

 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Answer
  • Jul 4, 2024 5:41 PM UTC

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

 

Translate

Forum|alt.badge.img+3
  • Author
  • Captain II
  • Jul 4, 2024 5:56 PM UTC

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.
 

 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jul 4, 2024 6:02 PM UTC

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

 

 

Translate

temberson
Freshman II
  • Freshman II
  • Jul 16, 2024 7:40 PM UTC

@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!

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Jul 19, 2024 10:37 AM UTC

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

Translate

temberson
Freshman II
  • Freshman II
  • Aug 20, 2024 1:22 PM UTC

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

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Aug 20, 2024 1:23 PM UTC

Great! Thanks for sharing the update.

Translate