Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Error Message: Indirect Cost % field can not be negative on purchase line.

(0) ShareShare
ReportReport
Posted on by 3,049 User Group Leader

Hi,

This error message appear in Dynamics NAV 2018, When try to create a Corrective Credit Memo from Posted Purchase Invoice.

The message appear as follows:

"Indirect Cost % field can not be negative on Purchase line"

Note that, Indirect Cost % have been checked on all items, and the value in all items on this field is ZERO.

Appreciate Your Help.

*This post is locked for comments

  • Suggested answer
    Ahmed Mohamed Rafik Profile Picture
    Ahmed Mohamed Rafik 3,049 User Group Leader on at
    RE: Error Message: Indirect Cost % field can not be negative on purchase line.

    Yes , it is Zero, and it can't be in a negative digits.

    I tired also to create new Credit Memo, but when i use "Get Lines" from the source Posted Purchase Invoice, give me also the same error.

    Anything can i check to be able to proceed with the Corrective Credit Memo?

  • Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Error Message: Indirect Cost % field can not be negative on purchase line.

    The field Line Discount Amount in the Purchase Line is zero?

  • Suggested answer
    Ahmed Mohamed Rafik Profile Picture
    Ahmed Mohamed Rafik 3,049 User Group Leader on at
    RE: Error Message: Indirect Cost % field can not be negative on purchase line.

    I check the amount in Purchase line and the discount on the posted purchase invoice, but i didn't find any discount amount on lines.

    Any recommendation?

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Error Message: Indirect Cost % field can not be negative on purchase line.

    It seems that on your Purchase Line you have a condition where "Direct Unit Cost" is different than  ("Line Discount Amount" / Quantity), then the following calculation returns a negative value:

    IndirectCostPercent :=

        ROUND(

          (UnitCostCurrency - "Direct Unit Cost" + "Line Discount Amount" / Quantity) /

          ("Direct Unit Cost" - "Line Discount Amount" / Quantity) * 100,0.00001);

    Try to check the amount in Purchase Line and the discount.

  • Suggested answer
    Ahmed Mohamed Rafik Profile Picture
    Ahmed Mohamed Rafik 3,049 User Group Leader on at
    RE: Error Message: Indirect Cost % field can not be negative on purchase line.

    The following appear after activate the debugger.

     IF ("Direct Unit Cost" <> 0) AND

        ("Direct Unit Cost" <> ("Line Discount Amount" / Quantity))

     THEN BEGIN

       IndirectCostPercent :=

         ROUND(

           (UnitCostCurrency - "Direct Unit Cost" + "Line Discount Amount" / Quantity) /

           ("Direct Unit Cost" - "Line Discount Amount" / Quantity) * 100,0.00001);

       IF IndirectCostPercentCheck(IndirectCostPercent) THEN

         "Indirect Cost %" := IndirectCostPercent

       ELSE

         ERROR(CannotBeNegativeErr,FIELDCAPTION("Indirect Cost %"));

     END ELSE

       "Indirect Cost %" := 0;

     UpdateSalesCost;

    Please advise.

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Error Message: Indirect Cost % field can not be negative on purchase line.

    Can you activate the debugger and show the line that throws this error?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans