Skip to main content
Question

Implementing a Date Picker Field in Acumatica 24R1 not working


Forum|alt.badge.img

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?

10 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

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


Forum|alt.badge.img

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.


andriitkachenko
Jr Varsity I
Forum|alt.badge.img+6

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.


RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • 253 replies
  • August 7, 2024

Forum|alt.badge.img

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


 


 




 



 


andriitkachenko
Jr Varsity I
Forum|alt.badge.img+6

Hi @rashmikamudalinayake10 

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

And I’ve got proper datetime field:


Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • August 9, 2024

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.

 


Forum|alt.badge.img

I have also experienced that, @aiwan

 


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

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

 


Forum|alt.badge.img

Filed a case. Let's see. 🤞


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