Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

The Purchase Line does not exist. Identification fields and values

(1) ShareShare
ReportReport
Posted on by 43

Hi everyone,

I hope you're all doing well. I'm currently facing an issue in Dynamics 365 Business Central and would appreciate any insights or solutions you might have.

Issue:

When creating a purchase order using the dropship functionality, I encounter an error stating that "The Purchase Line does not exist" (as seen in the screenshot below). This seems to be caused by my custom code that fills the "Area" field automatically based on the variant. I added the "Area" field in the variant table and linked it with the purchase line table. Here's the code snippet:

Error Message:

"The Purchase Line does not exist. Identification fields and values: Document Type='Order', Document No.='PO000095', Line No.='10000'"

  • Suggested answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    Teddy Herryanto (Th... 13,044 Moderator on at
    The Purchase Line does not exist. Identification fields and values
    You are not supposed to call modify there because there is a chance the record has not been inserted into the database.
  • Suggested answer
    MarceloBorges Profile Picture
    MarceloBorges 116 on at
    The Purchase Line does not exist. Identification fields and values
    There is not a lot of description on this message, but just by looking at the Screenshot, you should not be calling that "Modify()" clause in your code.
     
    You are placing code inside the OnValidate trigger of a table, and this trigger many times can be called over a record that hasn't been added to the database yet.
     
    If you're purpose is just to update the "Area" with the "Area" that you found on the Item Reference, all you have to do is assign the value, like you are doing (rec."Area" := itemRef."Area"), and stop there. 
     
    The Rec.Modify (or even Rec.Insert) will happen from the interface later on.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 8,852 Super User 2025 Season 1 on at
    The Purchase Line does not exist. Identification fields and values

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