When upgrading applications to v18R5 and above, keep in mind that that most entity selections in the upgraded version will be "shareable" by default. This means that they are shareable between processes, but cannot be modified or altered.
Due to the nature of "shareable" entity selections, you will encounter a runtime error when attempting to modify them. This will not affect member functions such as .query() or .orderBy() becuase they return a new entity selection. However, calling .add() on a "shareable" entity selection will cause an error.
If there are a lot of calls to .add() in your application, you may consider calling the function below to grant all new entity selections as alterable and not sharable by default in the current application datastores. This is mean't to be called once and placed in the On Startup database methods.
//On Startup Method dataStore.makeSelectionsAlterable( ) |
This setting is a quick way to restore the previous behavior quickly to prevent the errors. But, it is highly recommended to change the way the entity selections are handled and adapt to entity selections being shareable by default. This is becuase the setting prevents entity selections to be shared, which provides greater performance and scalability. This setting is mean't only for compatibility purposes.
For more information, please visit v18 R5 documentation