Hi experts,
I am facing a strange issue when posting inventory journal with session date.
Here is the step:
1. Today is 11/2/2024, and session date is changed to 10/31/2024.
2. Controller class is running with dialog and CanRunInNewSession = TRUE.
3. An inventory journal is created via x++ code, and the transaction date of lines are assigned with function DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()).
4. The transaction date of lines are created as Today instead of session date 10/31/2024.
I guess that the session date is lost when new session running, perhaps the value must be packed into current list?
However, I have looked into some standard code with CanRunInNewSession = true, pack and unpack methos are not implemented in most of them.
Can anyone give me some advice?
Thanks in advance.
Bernard