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 :
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 57

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'"

I have the same question (0)
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,268 Super User 2025 Season 2 on at
  • Suggested answer
    MarceloBorges Profile Picture
    122 on at
    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
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at
    You are not supposed to call modify there because there is a chance the record has not been inserted into the database.

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,329

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,250 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,365 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans