43
Views
1
Comments
[OutSystems Data Grid] GetRowData can't get date value
Application Type
Reactive
Service Studio Version
11.54.58 (Build 63262)
Platform Version
11.18.1 (Build 38276)

Hello,


As the title suggests, I’m having trouble understanding the difference between using the DataGrid API’s GetChangedLines and GetRowData. Let me explain further based on the behavior of the attached sample module:


When editing a date field in the DataGrid on the screen and attempting to retrieve its value using any Client Action:

With GetChangedLines, you can obtain the date value exactly as entered on the screen.

However, with GetRowData, the value becomes NullDate (1900/01/01).

I understand that you want to retrieve values using GetRowData even for rows where the value hasn’t changed (i.e., unchanged rows). Is there a way to work around this issue?


Sample Module Instructions:

1. Open the “DataGrid” screen.

2. Change the date in the first row of the “Birth Date” column to any date.

3. Click the “Kick Action” button.

4. The top of the screen will display the dates retrieved using GetChangedLines and GetRowDat

DataGrid_GetRowData.oml
2024-06-08 15-17-54
Nawaz Khan

This is the Data type issue

The issue is when you are using the GetChangedLines its giving you the exact same data type which is DATE in your case and when you use GetRowData you are getting datatype as DateTime instead of Date while during the JSON deserialization for the returned data from GetRowData there is DATETIME datatype (not matched with the provided structure which is BirthDate as Date) thus JSON deserialization is not succussed against the BirthDate and you get default datetime value as 1900-01-01

In order to fix that you need to duplicate your SampleUsers structure for the GetRowData only and set the data type for the BirthDate as DateTime.

Of course you can change the datetime to date any time by using the provided actions if you want to display anywhere without time

Attached is the update code.

DataGrid_GetRowData.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.