Applies ToDynamics NAV 2009

This article applies to Microsoft Dynamics NAV for all countries and all language locales.

Symptoms

When you create a service contract (not prepaid) and change the invoice before posting in Microsoft Dynamics NAV 2009, there is inconsistent data between service ledger entries and general ledger. This problem occurs in the following products:

  • Microsoft Dynamics NAV 2009 R2

  • Microsoft Dynamics NAV 2009 Service Pack 1

Resolution

Hotfix information

A supported hotfix is now available from Microsoft. However, it is only intended to correct the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Dynamics NAV 2009 service pack or the next Microsoft Dynamics NAV version that contains this hotfix. Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Technical Support Professional for Microsoft Dynamics and related products determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Installation information

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Note Before you install this hotfix, verify that all Microsoft Navision client users are logged off the system. This includes Microsoft Navision Application Services (NAS) client users. You should be the only client user who is logged on when you implement this hotfix.To implement this hotfix, you must have a developer license.We recommend that the user account in the Windows Logins window or in the Database Logins window be assigned the "SUPER" role ID. If the user account cannot be assigned the "SUPER" role ID, you must verify that the user account has the following permissions:

  • The Modify permission for the object that you will be changing.

  • The Execute permission for the System Object ID 5210 object and for the System Object ID 9015 object.

Note You do not have to have rights to the data stores unless you have to perform data repair.

Code changes

Note Always test code fixes in a controlled environment before you apply the fixes to your production computers. To resolve this problem, follow these steps:

  1. Change the code in the Document Dimension table (357) as follows:Existing code 1

    ...      Text005@1009 : TextConst 'ENU=Canceled.';      Text006@1010 : TextConst 'ENU=You may have changed a dimension. Some lines are already shipped. When you post the line with the changed dimension to the general ledger, amounts on the Inventory Interim account will be out of balance when reported per dimension.\\Do you want to update the lines?';    PROCEDURE UpdateGlobalDimCode@25(GlobalDimCodeNo@1000 : Integer;"Table ID"@1001 : Integer;"Document Type"@1002 : Option;"Document No."@1003 : Code[20];"Line No."@1004 : Integer;NewDimValue@1005 : Code[20]);...

    Replacement code 1

    ...      Text005@1009 : TextConst 'ENU=Canceled.';      Text006@1010 : TextConst 'ENU=You may have changed a dimension. Some lines are already shipped. When you post the line with the changed dimension to the general ledger, amounts on the Inventory Interim account will be out of balance when reported per dimension.\\Do you want to update the lines?';      Text007@1011 : TextConst 'ENU=You cannot change the dimension because the document is based on a service contract.';    PROCEDURE UpdateGlobalDimCode@25(GlobalDimCodeNo@1000 : Integer;"Table ID"@1001 : Integer;"Document Type"@1002 : Option;"Document No."@1003 : Code[20];"Line No."@1004 : Integer;NewDimValue@1005 : Code[20]);...

    Existing code 2

    ...    PROCEDURE VerifyLineDim@5(VAR DocDim@1000 : Record 357);    VAR      SalesLine@1001 : Record 37;      PurchaseLine@1002 : Record 39;    BEGIN      CASE "Table ID" OF        DATABASE::"Sales Line":          BEGIN            IF SalesLine.GET(DocDim."Document Type",DocDim."Document No.",DocDim."Line No.") THEN              IF (SalesLine."Qty. Shipped Not Invoiced" <> 0) OR (SalesLine."Return Rcd. Not Invd." <> 0) THEN                IF NOT CONFIRM(Text004,TRUE,SalesLine.TABLECAPTION) THEN                  ERROR(Text005)          END;        DATABASE::"Purchase Line":          BEGIN            IF PurchaseLine.GET(DocDim."Document Type",DocDim."Document No.",DocDim."Line No.") THEN              IF (PurchaseLine."Qty. Rcd. Not Invoiced" <> 0) OR (PurchaseLine."Return Qty. Shipped Not Invd." <> 0) THEN                IF NOT CONFIRM(Text004,TRUE,PurchaseLine.TABLECAPTION) THEN                  ERROR(Text005)          END;      END;    END;...

    Replacement code 2

    ...    PROCEDURE VerifyLineDim@5(VAR DocDim@1000 : Record 357);    VAR      SalesLine@1001 : Record 37;      PurchaseLine@1002 : Record 39;      ServiceHeader@1003 : Record 5900;      ServiceLine@1004 : Record 5902;    BEGIN      CASE "Table ID" OF        DATABASE::"Sales Line":          BEGIN            IF SalesLine.GET(DocDim."Document Type",DocDim."Document No.",DocDim."Line No.") THEN              IF (SalesLine."Qty. Shipped Not Invoiced" <> 0) OR (SalesLine."Return Rcd. Not Invd." <> 0) THEN                IF NOT CONFIRM(Text004,TRUE,SalesLine.TABLECAPTION) THEN                  ERROR(Text005)          END;        DATABASE::"Purchase Line":          BEGIN            IF PurchaseLine.GET(DocDim."Document Type",DocDim."Document No.",DocDim."Line No.") THEN              IF (PurchaseLine."Qty. Rcd. Not Invoiced" <> 0) OR (PurchaseLine."Return Qty. Shipped Not Invd." <> 0) THEN                IF NOT CONFIRM(Text004,TRUE,PurchaseLine.TABLECAPTION) THEN                  ERROR(Text005)          END;        DATABASE::"Service Header":          IF ServiceHeader.GET(DocDim."Document Type",DocDim."Document No.") AND (ServiceHeader."Contract No." <> '') THEN            ERROR(Text007);        DATABASE::"Service Line":          IF ServiceLine.GET(DocDim."Document Type",DocDim."Document No.",DocDim."Line No.") THEN            IF (ServiceLine."Contract No." <> '') THEN              ERROR(Text007);      END;    END;...
  2. Change the code in the Service Line table (5902) as follows:Existing code 1

    ...               IF (Quantity <> 0) AND ItemExists(xRec."No.") AND                  (("Spare Part Action" = "Spare Part Action"::"Component Replaced") OR                   ("Spare Part Action" = "Spare Part Action"::"Component Installed") OR                   ("Spare Part Action" = "Spare Part Action"::" "))               THEN                 ReserveServLine.VerifyChange(Rec,xRec);             END;    OnDelete=VAR...

    Replacement code 1

    ...               IF (Quantity <> 0) AND ItemExists(xRec."No.") AND                  (("Spare Part Action" = "Spare Part Action"::"Component Replaced") OR                   ("Spare Part Action" = "Spare Part Action"::"Component Installed") OR                   ("Spare Part Action" = "Spare Part Action"::" "))               THEN                 ReserveServLine.VerifyChange(Rec,xRec);               IF "Document Type" = ServiceLine."Document Type"::Invoice THEN                 IF ("Appl.-to Service Entry" <> 0) AND ("Contract No." <> '') THEN                   ERROR(Text046);             END;    OnDelete=VAR...

    Existing code 2

    ...    { 5   ;   ;Type                ;Option        ;OnValidate=BEGIN                                                                GetServHeader;                                                                TESTFIELD("Qty. Shipped Not Invoiced",0);...

    Replacement code 2

    ...    { 5   ;   ;Type                ;Option        ;OnValidate=BEGIN                                                                IF ("Appl.-to Service Entry" <> 0) AND ("Contract No." <> '') THEN                                                                  ERROR(Text046);                                                                GetServHeader;...

    Existing code 3

    ...    { 6   ;   ;No.                 ;Code20        ;TableRelation=IF (Type=CONST(" ")) "Standard Text"                                                                 ELSE IF (Type=CONST(G/L Account)) "G/L Account"                                                                 ELSE IF (Type=CONST(Item)) Item                                                                 ELSE IF (Type=CONST(Resource)) Resource                                                                 ELSE IF (Type=CONST(Cost)) "Service Cost";                                                   OnValidate=VAR                                                                ShowLocMessage@1000 : Boolean;                                                              BEGIN                                                                TESTFIELD("Qty. Shipped Not Invoiced",0);...

    Replacement code 3

    ...    { 6   ;   ;No.                 ;Code20        ;TableRelation=IF (Type=CONST(" ")) "Standard Text"                                                                 ELSE IF (Type=CONST(G/L Account)) "G/L Account"                                                                 ELSE IF (Type=CONST(Item)) Item                                                                 ELSE IF (Type=CONST(Resource)) Resource                                                                 ELSE IF (Type=CONST(Cost)) "Service Cost";                                                   OnValidate=VAR                                                                ShowLocMessage@1000 : Boolean;                                                              BEGIN                                                                IF ("Appl.-to Service Entry" <> 0) AND ("Contract No." <> '') THEN                                                                  ERROR(Text046);                                                                TESTFIELD("Qty. Shipped Not Invoiced",0);...

    Existing code 4

    ...    { 22  ;   ;Unit Price          ;Decimal       ;OnValidate=BEGIN                                                                GetServHeader;                                                                IF ("Unit Price" > ServHeader."Max. Labor Unit Price") AND...

    Replacement code 4

    ...    { 22  ;   ;Unit Price          ;Decimal       ;OnValidate=BEGIN                                                                GetServHeader;                                                                IF ("Appl.-to Service Entry" > 0) AND (CurrFieldNo <> 0) THEN                                                                  ERROR(Text046,FIELDCAPTION("Unit Price"));                                                                IF ("Unit Price" > ServHeader."Max. Labor Unit Price") AND...

    Existing code 5

    ...      Text043@1097 : TextConst 'ENU=You cannot change the value of the %1 field manually if %2 for this line is %3';      Text044@1012 : TextConst 'ENU=Do you want to split the resource line and use it to create resource lines\for the other service items with divided amounts?';      Text045@1099 : TextConst 'ENU=You cannot delete this service line because one or more service entries exist for this line.';...

    Replacement code 5

    ...      Text043@1097 : TextConst 'ENU=You cannot change the value of the %1 field manually if %2 for this line is %3';      Text044@1012 : TextConst 'ENU=Do you want to split the resource line and use it to create resource lines\for the other service items with divided amounts?';      Text045@1099 : TextConst 'ENU=You cannot delete this service line because one or more service entries exist for this line.';     Text046@1100 : TextConst 'ENU=You cannot modify the document because it is based on a service contract.';...

Prerequisites

You must have one of the following products installed to apply this hotfix:

  • Microsoft Dynamics NAV 2009 R2

  • Microsoft Dynamics NAV 2009 Service Pack 1

Removal information

You cannot remove this hotfix.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.