diff --git a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs index b7c026f7..62e9edbc 100644 --- a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs +++ b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs @@ -1215,7 +1215,10 @@ namespace VEPROMS else { revision = Revision.GetByItemIDAndRevisionNumber(pi.ItemID, ap.RevNumber); - if (revision == null) // no revision yet, need to set the StartDate. If there is a revision, it uses the revision date as the startdate + // B2021-101: don't ask about replace of existing revision if there is no revision version. For an approval, + // the revision is created first & then connected to the version. If the approval was canceled or something else + // went wrong, the revision could be created but not the version. Added the count check below. + if (revision == null || revision.RevisionVersionCount==0) // no revision yet, need to set the StartDate. If there is a revision, it uses the revision date as the startdate { RevisionConfig cfg = new RevisionConfig(); cfg.History_StartDate = pi.DTS; // todo: this should probably be myDTS, found during fix of B2019-051.