LastModifiedDateTime has wrong datetime information

Hello everybody,

today I want to share interesting use case which raised recently when dealt with syncrhonization of records between Magento and Acumatica.

I had following declaration:

#region LastModifiedDateTime
[PXDBDateAndTime()]
[PXUIField(DisplayName = "Last Modified Date Time")]
public virtual DateTime? LastModifiedDateTime { getset; }
public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
#endregion

and for my disappointment as well as disappointment of Magento developers we had to add some hours shift to each call, in order to filter out properly by Last modified Date time.

One of the solutions was to add one more flag to attributes in LastModifiedDateTime: UseTimeZone. By default that attribute is set to true, but in my case it was necessary to set it to false:

#region LastModifiedDateTime
[PXDBDateAndTime(UseTimeZone = false)]
[PXUIField(DisplayName = "Last Modified Date Time")]
public virtual DateTime? LastModifiedDateTime { getset; }
public abstract class lastModifiedDateTime : PX.Data.BQL.BqlDateTime.Field<lastModifiedDateTime> { }
#endregion

After I've made usage of that attribute, values in UI started to display according to what I've seen on db level.

Summary

In case if you see discrepancy between value on db, and UI, and want to have only db level displayed in UI, use flat UseTimeZone set to false.

CreatedByID cannot be null in Acumatica

Hello everybody,

today I want to share how to cope with error message CreatedByID cannot be null and CreatedByScreenID cannot be null, and so on. In order to get rid of

those error messages use attributes [PXDBCreatedByID], [PXDBCreatedByScreenID],

 [PXDBCreatedDateTime], [PXDBLastModifiedByID], [PXDBLastModifiedByScreenID], 

 [PXDBLastModifiedDateTime], [PXDBTimestamp]. 

If somebody has a question, how I got such error message, the answer is simple. DAC generator generated those fields for me without those attributes, so only with the help of reflector I realized how to fix my issue.