Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 release wave 1Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I have a PHP script that inserts Quotes for us. The basic procedure is:
This has been active for years and works fine. Today I started a new script that needs to insert Sales Lines onto Orders instead of Quotes. The final insert is literally exactly the same as the Quote insert (using all of the same code), except two fields are different:
Unfortunately this fails every time, with this error:
"The field Document No. of table Sales Line contains a value (SO56789) that cannot be found in the related table (Sales Header)."
Looking at the tables in Nav, the Sales Line table has column 'Document No.' with value 'SO56789' and the Sales Header table has column 'No.' with value 'SO56789'. I can't figure out why it fails. It's worth emphasizing that this works fine as a quote - all code is exactly the same, column names are the same, etc.
Is there some other field I have to pass to insert a line on an Order document?
how are the web services published? If they have published a sales quote or something which has the filter for document type then you cannot create an order using the same service.
I'm not sure if this is what you were getting at Suresh but I checked the Keys for each table in question (Sales Header and Sales Line), then I compared them to the Web Services Pages I had created (WS_SalesHeader and WS_SalesLine). They were not in the same order.
For example the Keys for Sales Header table were 'Document Type,No.' and Keys for Sales Line were 'Document Type,Document No.,Line No.'.
Meanwhile my WS_SalesLine had the columns in this order: 'Document No., Line No., <other columns>, Document Type'. My WS_SalesHeader had the columns in this order: 'Document Type, <other columns>, No.'.
So I changed my Services so the keys were defined first, and in the same order as the actual table definitions. That solved the problem - Sales Lines are now inserted correctly for both Quotes and Orders.
I'm not sure why these Web Services worked fine for Quotes but failed for Orders, but at least it's working now.
Business Applications communities