Skip to main content
Question

Implementing a Date Picker Field in Acumatica 24R1 not working


I am using version 24.106.0018. I created a date field named UsrXYZ. Below is my code:

#region UsrXYZ
[PXDBDate]
[PXUIField(DisplayName="Date")]
public virtual DateTime? UsrXYZ { get; set; }
public abstract class usrXYZ : PX.Data.BQL.BqlDateTime.Field<usrXYZ> { }
#endregion

 However, in SSMS, it showed as below: 

SELECT 
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
NUMERIC_PRECISION,
NUMERIC_SCALE
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME = 'RQRequisition' AND COLUMN_NAME = 'UsrXYZ';

I need a Date picker field. What am I doing wrong here?

Hi @rashmikamudalinayake10,

I tested in two different tables/DACs and I couldn’t reproduce the issue. Below is the info of the field that’s being created in the DB,

 

If the issue is consistently reproducible, kindly share the steps to reproduce the issue.

Thanks & Good Luck.!


It's strange behavior. It's still the same, so I just made the customization on version 23.108.00201. It worked on that version, but it didn’t work on 24R1. I think there might be something wrong with my database, but I'm not sure.


Hi @rashmikamudalinayake10 

Your field declaration in the C# DAC class doesn’t affect how the column is created in your database.

There are 2 ways of setting the field:

  • Add to the customization and publish;  
  • Create manually in the database.

My best guess would be that you might create the field as nvarchar(25) using one of those 2 methods and then didn’t republish your customization to change the field.

I’d try to double-check the correct type of the field (first on the Database Scripts page of the Customization, and then use FIle → Edit Project Times to review the file with that column to make sure it also has type date).

If everything is correct - try Publish customization. It should change the field type. If not - try also Publish with Cleanup (this operation forces db changes even if the Customization Engine decided that they should be omitted).

If both Publish attempts failed - try the same customization on the fresh instance of the same version. This might not resolve the issue, but at least will show you if this is an instance/database issue or something with the build.


@rashmikamudalinayake10 I would be more interested in seeing your aspx code for that field. 

some links to review:

acumatica - Display Date and Time of fPXDBDate] in single grid field - Stack Overflow

Date and Time picker for Acumatica PXGridColumn - Stack Overflow


@RohitRattan88  @andriitkachenko 


@andriitkachenko I tried the same thing by re-installing a new 24R1 instance and got the same results, but it works on 23R1.🤷

Below are the screenshots of the project items and the ASPX code.
 


 


 




 



 


Hi @rashmikamudalinayake10 

I’ve tried to reproduce it on my 24R1 instance:

And I’ve got proper datetime field:


hi @rashmikamudalinayake10 

 

I experienced a similar issue with CROpportunity table, however it was the length of the string which was affected, not the type of field.

This was in 22R2, on a hosted instance.

I used an SQL script to change the length.

 


I have also experienced that, @aiwan

 


@aiwan, thanks for your inputs.

@rashmikamudalinayake10, if you are able reproduce this behavior/issue in 24R1, please create a support case reporting the issue.

Thanks, 

 


Filed a case. Let's see. 🤞


Reply