Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

The Remaining Quantity in the RG 23 D entry is incorrect after you post a purchase credit memo in the Indian version of Microsoft Dynamics NAV 2009 SP1


View products that this article applies to.

This article applies to Microsoft Dynamics NAV for the Indian (in) language locale.

↑ Back to the top


Symptoms

Assume that you post a partial return shipment for a purchase order in the Indian version of Microsoft Dynamics NAV 2009 Service Pack 1 (SP1). After you post the created purchase credit memo by using the Get Return Shipment Lines function, you notice that the Remaining Quantity in the RG 23 D entry is incorrect.

↑ Back to the top


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.


↑ Back to the top




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, but 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. Add the following global variable in the Sales Linetable (37):
    • Name: ExecuteExcise
    • DataType: Boolean
  2. Add the following variable in the CalculateStructuresfunction in the Sales Linetable (37):
    • Name: DetailRG23D
    • DataType: Record; 16533

    Change the code as follows:
    ...
    END;
    UNTIL StrOrderDetails.NEXT = 0;
    END;
    SalesLine.MODIFY;
    UNTIL SalesLine.NEXT = 0;

    // Add the following l ines.
    IF NOT ExecuteExcise THEN BEGIN
    DetailRG23D.RESET;
    DetailRG23D.SETRANGE("Document Type","Document Type");
    DetailRG23D.SETRANGE("Order No.","No.");
    DetailRG23D.SETRANGE("Document No.",'');
    DetailRG23D.DELETEALL;
    END;
    // End of the added lines.
    ...
  3. Add the following variable in the CheckAvailableQtyForReturnfunction in the Sales Linetable (37):
    • Name: RG23D2
    • DataType: Record; 16537

    Change the code as follows:
    ...
    IF RG23D.FINDSET THEN
    REPEAT
    // Delete the following line.
    QtyAllocated += ABS(RG23D.Quantity);
    // End of the deleted line.

    // Add the following lines.
    RG23D2.GET(RG23D."Ref. Entry No.");
    RG23D2.CALCFIELDS("Remaining Quantity");
    QtyAllocated += ABS(RG23D2.Quantity - RG23D2."Remaining Quantity");
    // End of the added lines.

    UNTIL RG23D.NEXT = 0;
    ...
  4. Create the SetExecuteExcisefunction in the Sales Linetable (37). Then, add the following Parameter:
    • Name: ExecuteExcise2
    • DataType: Boolean

    Add the following code:
    ExecuteExcise := ExecuteExcise2;
  5. Add the following global variable in the Purchase Linetable (39):
    • Name: ExecuteExcise
    • DataType: Boolean
  6. Add the following variable in the CalculateStructuresfunction in the Purchase Linetable (39):
    • Name: DetailRG23D
    • DataType: Record; 16533

    Change the code as follows:
    ...
    END;
    UNTIL StrOrderDetails.NEXT = 0;
    END;
    PurchLine.MODIFY;
    UNTIL PurchLine.NEXT = 0;

    // Add the following lines.
    IF NOT ExecuteExcise THEN BEGIN
    DetailRG23D.RESET;
    DetailRG23D.SETRANGE("Document Type","Document Type");
    DetailRG23D.SETRANGE("Order No.","No.");
    DetailRG23D.SETRANGE("Document No.",'');
    DetailRG23D.DELETEALL;
    END;
    // End of the added lines.

    END;
    END;
    END;
    ...
  7. Create the SetExecuteExcisefunction in the Purchase Linetable (39). Then, add the following Parameter:
    • Name: ExecuteExcise2
    • DataType: Boolean

    Add the following code:
    ExecuteExcise := ExecuteExcise2;
  8. Change the code in the Propertiesin the Sales -Postcodeunit (80) as follows:
      ...
    SalesLine.GetSalesPriceExclusiveTaxes(SalesHeader);
    SalesLine.UpdateSalesLinesPIT(SalesHeader);
    END;

    IF Structure <> '' THEN BEGIN

    // Add the following lines.
    SalesLine.SetExecuteExcise(
    ("Document Type" IN ["Document Type"::"Credit Memo","Document Type"::Invoice]) OR
    (("Document Type" IN ["Document Type"::"Return Order",
    "Document Type"::Order]) AND
    Invoice));
    // End of the added lines.

    SalesLine.CalculateStructures(SalesHeader);
    SalesLine.AdjustStructureAmounts(SalesHeader);
    SalesLine.UpdateSalesLines(SalesHeader);
    CheckVATSettled(SalesHeader);
    END;
    ...
  9. Change the code in the Propertiesin the Purch.-Postcodeunit (90) as follows:
      ...
    TESTFIELD("Document Date");
    IF GenJnlCheckLine.DateNotAllowed("Posting Date") THEN
    FIELDERROR("Posting Date",Text045);

    IF Structure <> '' THEN BEGIN

    // Add the following lines.
    PurchLine.SetExecuteExcise(("Document Type" = "Document Type"::"Credit Memo") OR
    (("Document Type" = "Document Type"::"Return Order") AND Invoice));
    // End of the added lines.

    PurchLine.CalculateStructures(PurchHeader);
    COMMIT;
    CheckVATSettled;
    PurchLine.AdjustStructureAmounts(PurchHeader);
    PurchLine.UpdatePurchLines(PurchHeader);
    ...

Prerequisites

You must have the Indian version of Microsoft Dynamics NAV 2009 Service Pack 1 (SP1) installed to apply this hotfix.

Removal information

You cannot remove this hotfix.

↑ Back to the top


Status

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

↑ Back to the top


References

VSTF DynamicsNAV SE: 209399

↑ Back to the top


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.

↑ Back to the top


Keywords: kbqfe, kbmbsquickpub, kbmbscodefix, kbmbsmigrate, kbmbspartner, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 2514363
Revision : 3
Created on : 1/31/2017
Published on : 1/31/2017
Exists online : False
Views : 193