web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

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

  • Suggested answer
    Ahmed Mohamed Rafik Profile Picture
    3,049 User Group Leader on at

    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
    37,166 Most Valuable Professional on at

    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
    3,049 User Group Leader on at

    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?

  • Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

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

  • Suggested answer
    Ahmed Mohamed Rafik Profile Picture
    3,049 User Group Leader on at

    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?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans