137
Often there is a situation where you want to store a value at the beginning of a process, which you want to access in a subscriber later in the process. If the information is not available via the provided publishers, the most common way is to create a single instance codeunit and store the value there.
If the process runs on an error after setting the value, the content of the variables within the single instance codeunit is preserved and no rollback is performed on the variables.
I suggest to create the possibility to introduce a new property "RolleBackAtError = true" (Default value = false) in a Single Instance Codeunit. If the property is set, the content of the global variables should be reset (maybe only the support of temporary record variables would be sufficient here).
This way you could achieve that no "dirty reads" on the stored variable values from other processes would be possible.
If the process runs on an error after setting the value, the content of the variables within the single instance codeunit is preserved and no rollback is performed on the variables.
I suggest to create the possibility to introduce a new property "RolleBackAtError = true" (Default value = false) in a Single Instance Codeunit. If the property is set, the content of the global variables should be reset (maybe only the support of temporary record variables would be sufficient here).
This way you could achieve that no "dirty reads" on the stored variable values from other processes would be possible.
STATUS DETAILS
Needs Votes

Business Central Team (administrator)
Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we might consider it in the future.
Best regards,
Business Central Team