[OSPRD1].DBO.[OSUSR_DL9_TEMPSCOPEITEM] with key 309440 was not found

The stack for the error is:  [OSPRD1].DBO.[OSUSR_DL9_TEMPSCOPEITEM] with key 309440 was not found
   at ssAnscoScoping_UI.ExtendedActions.GetTempScopeItemForUpdate(HeContext heContext, Int64 inParamId, RCTempScopeItemRecord& outParamRecord)
   at ssAnscoScoping_UI.Flows.FlowMainFlow.ScrnSetupScopes.CommandOnChange(HeContext heContext)

This happens sporadically in production and I can't duplicate it in dev.  Simply put, the user chooses a category from a previous screen, the action on that screen writes data to the TempScopeItem table.  The user is then transferred to a new screen where the data from the table TempScopeItem is displayed - (This may consist of many lines of data).  The user then goes through  the listing and modifies quantities on each line, When the user changes the quantities we are capturing that change and calling the GetTempScopeItemForUpdate object (that was created by Outsystems when the table was created).  We are passing the id of the lineitem from the displayed table (Tabular layout) object.  Most of the time there is no issue and the update occurs as expected, however, when this error occurs, it appears that the table has been emptied as refreshing the data source and attempting to do an ajax refresh on the widget fails to return any data from the table.


Any help or suggestions are greatly appreciated.


James


Hello Jams.

TempScopeItem is an Entity?
The error really means that the record with that ID was not found.

And if the data refresh and ajax refresh returns nothing, the table being fully cleared, or at least this user data, is probably the reason. 

Being a "temporary" entity (if the name is meaningful), I assume you have some code to do clean up of the entity after some condition. Or maybe you have a timer that cleans the entity?

Could you check exactly when this is done and if there is any "special" condition that could trigger the cleaning (like an error, or an wrong option set by the user, etc)?

Cheers.