Error on Data Upgrade frpm 2013 R2 to 2015

RydenRyden Member Posts: 24
edited 2015-03-25 in NAV Three Tier
I'm running an upgrade frpm 2013 R2 to 2015 and have reached task 10 in the "Upgrading the data" document
https://msdn.microsoft.com/en-us/librar ... 8(v=nav.80).aspx

I get this error and I'm not quite sure what to do about it
SessionId    : 2654
CodeunitId   : 104025
FunctionName : UpdateSourceCodeSetup
CompanyName  : CompanyName Master
StartTime    : 2015-02-04 10:02:43
Duration     : 
State        : FailedPendingResume
Error        : The Source Code already exists. Identification fields and values: Code='PAYMTRECON'

It's an upgrade object and should be consistent with the script.

The Start-NavDataUpgrade script is imported from a DLL, is there any way I can get the source code of this script to see what might generate the error?
--
www.nabsolutions.se

Comments

  • RydenRyden Member Posts: 24
    Apparently, this function ran more than once which caused an error on the second insert.
    A QaD fix allowed me to run the task to completion.
    Still not sure if this I s a bug or not...
    [Upgrade] UpdateSourceCodeSetup()
    WITH SourceCodeSetup DO BEGIN
      GET;
      "Payment Reconciliation Journal" := 'PAYMTRECON';
      MODIFY;
    END;
    
    WITH SourceCode DO BEGIN
      INIT;
      Code := SourceCodeSetup."Payment Reconciliation Journal";
      Description :=
        COPYSTR(
          ObjectTranslation.TranslateObject(
            ObjectTranslation."Object Type"::Page,PAGE::"Payment Reconciliation Journal"),1,30);
    // ADJ0000
    //  INSERT;
     IF NOT INSERT THEN;
    //0000
    END;
    
    --
    www.nabsolutions.se
  • sundfarsundfar Member Posts: 28
    We are experiencing the same issue. Can you explain what an QaD fix are and how to obtain one?

    regards, Gunnar
  • RydenRyden Member Posts: 24
    Hej Gunnar

    QaD is short for "Quick and Dirty", I just treated the symptoms instead of the cause.

    If you look at the source code below you'll see that I changed the INSERT; statement into IF NOT INSERT THEN; which is a quick way of ignoring any errors.
    It's bad programming, much like the IF NOT INSERT THEN MODIFY approach, but it will get us through the upgrade.
    I just keep on overwriting the record with the same data until the process is through.

    Ha det!
    //Anders
    WITH SourceCode DO BEGIN
      INIT;
      Code := SourceCodeSetup."Payment Reconciliation Journal";
      Description :=
        COPYSTR(
          ObjectTranslation.TranslateObject(
            ObjectTranslation."Object Type"::Page,PAGE::"Payment Reconciliation Journal"),1,30);
    // ADJ0000
    //  INSERT;
     IF NOT INSERT THEN;
    //0000
    END;
    
    --
    www.nabsolutions.se
  • sundfarsundfar Member Posts: 28
    Tjäna, Anders.
    QaD, I see. Like swallowing exceptions. Not good, but a fix.

    Thanks, Gunnar
  • RydenRyden Member Posts: 24
    Exactly!
    Not sure what the underlaying issue is, I've had some upgrades pass this obstacle without a hitch and others stuck on this error
    --
    www.nabsolutions.se
  • ericnericn Member Posts: 2
    I got this problem during a 2013 to 2016 upgrade. This was due to forcing the complete table sync rather than handling the individual tables one by one the custom upgrade script. The complete force overrode the custom settings used in the standard upgrade script.

    Hej Anders!
Sign In or Register to comment.