• Error: "Someone else modified this document at the same time"

    By Mark Demicoli 2 decades ago

    This error occurs during QAF Deployment when the Soft Deletions feature is enabled in destination databases(s).



    SOLUTION

    Disable Soft Deletions temporarily in the destination database(s)

    • Here's a way to trap this condition...

      By Kevin Pettitt 2 decades ago

      Should have looked here earlier. I had found the same problem.



      Here is some code that can be inserted into the QAFDeployBase subroutine in the _QAF WF Builder script library (I've included some existing code at the top of the block to show where I'm placing it):







      UPDATE: It looks like the "SetOption" calls have no effect in this context, so the best you can do is probably to just detect that soft deletions are enabled for <database name> and present the user with a notice. They could then "continue processing or stop here?".



      If destDB.CurrentAccessLevel < 5 Then

      Msgbox &quot;You do not have Designer or Manager access to the destination database: &quot; &amp; destDB.filepath,16,&quot;Error&quot;<br/>
      Exit Sub<br/>
      

      End If

              <br/>
      

      If destDB.GetOption(DBOPT_SOFTDELETE) Then

      disableSoftDelete = Messagebox (&quot;The destination database has soft deletions enabled.&quot; &amp; Chr(10) &amp; Chr(10) &amp; _<br/>
      &quot;You must disable soft deletions before deploying QAF, however doing so will&quot; &amp; Chr(10) &amp; _<br/>
      &quot;cause any documents in a soft-deleted state to be removed permanently&quot; &amp; Chr(10) &amp; Chr(10) &amp; _<br/>
      &quot;Do you want to DISABLE SOFT DELETIONS NOW?&quot;, 4 + 32 + 256, &quot;Soft Deletions Enabled&quot;)<br/>
      If disableSoftDelete = 6 Then<br/>
          'User selected &quot;YES&quot; to disable soft deletions in the destination db<br/>
          Call destdb.SetOption(DBOPT_SOFTDELETE, False)  'disable soft deletions<br/>
          softdeletehours% = destDB.UndeleteExpireTime<br/>
      Else<br/>
          Messagebox &quot;Deployment of QAF to the destination database has been cancelled&quot;, 64, &quot;Deployment Cancelled&quot;<br/>
          Exit Sub<br/>
      End If<br/>
      

      End If



      Later on - you can decide where - you can re-enable soft deletions with this (but be sure it's within a given destdb loop):



      If disableSoftDelete = 6 Then

      Call destDB.SetOption(DBOPT_SOFTDELETE, True)<br/>
      destDB.UndeleteExpireTime = softdeletehours%<br/>
      

      End If



      Note that this is not tested beyond knowing that I can detect the setting, but if there are problems, you can certainly fall back to just skipping that particular db with some sort of notification.

      • thanks Kevin

        By Mark Demicoli 2 decades ago

        … far more elegant.