Quintiq file version 2.0
|
#parent: #root
|
Method RemoveSavedDebugMemoryOnlyDataset (
|
LibOpt_Task task
|
)
|
{
|
TextBody:
|
[*
|
rcm := RunContextMeta::GetRunContextMeta( task.Run() );
|
if ( rcm.OptionDebugCopyDataSetForSaveRollback() )
|
{
|
// Automaticaly Delete corresponding Dataset when a scenario object is deleted
|
editor := MDSEditor::Editor();
|
objectInfos := MDSEditor::Editor().ObjectInfos();
|
|
dataset := select( objectInfos, Elements, o, o.MDSID().MDSKey() = this.MDSIDLastSavedDebugDataset() );
|
|
if( not isnull( dataset ) )
|
{
|
info( 'Removing debug memory only dataset', dataset.Name() );
|
if( dataset.IsLoaded() ) // Memory-only datset should only use Unload to delete
|
{
|
editor.UnloadMDS( dataset.MDSID() );
|
}
|
if( dataset.IsStoredInDB()) // Dataset with storage should be unloaded first, then delete here
|
{
|
editor.DeleteMDS( dataset.MDSID() );
|
}
|
}
|
}
|
*]
|
InterfaceProperties { Accessibility: 'Module' }
|
}
|