Announcements
Hi
I used the API https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_salesorderline_update to fulfill a line item of an order,
updated shipQuantity, and invoiceQuantity, and got an Ok response, but I see the ShippedQuantity is still empty. what is the reason for that, do I have to make another API Call for this?
I also noticed this ShippedQuantity is a read-only field, we can't set this value
Thanks in advance!
Thanks, Inge M. Bruvik
I am following you now atTwitter :)
I am happy to hear that it finally works. And you know where to go if you get into any issues with the credit memos. The community is more than happy to try to help you.
Hi
Inge M. Bruvik
Wahoo, It finally worked.
Thank you so much
Now My next hurdle would be of Return, creating a credit memo of line items of an order. I will have to explore how it works.
I hope I will not get any issues with the same
Thanks again
Hi,
I thought this looked good. Only posting seems to be missing here now.
So if you do posting now either from the bound action in the API or manually in GUI you should get the expected result. Only the second item line on each order should be posted.
So go for a posting and lets see what happens. I have faith
Hi
Inge M. Bruvik
I followed the same now.
My order has 2 articles.
I fulfilled 1 set shipQuantity = 1 and API response was Success, Ok
I fulfilled 2nd with shipQuantity = 0 and API response was Success, OK
Before
After
2nd Case
with the new order (with 2 articles), I set both shipQuantity and invoiceQuantity=1 for 1st article, and for 2nd article, I set both shipQuantity and invoiceQuantity=0
I get Sucess, Ok response for both.
and here is what I can see in my Order at UI.
What do you think I have missed here?
Maybe it is me who have been a bit unclear or i do not completely understand you.
For all lines that you do not want to post shipment for the shipQuantity needs to be set to zero (0)
The same goes for the invoiceQuantity. All lines that you do not want to invoice must have invoiceQuantity set to zero (O).
So how do the order lines look after you have set the shipQuantity and invoiceQuantity
If you wanted to only to shipment and what happen is that invoice is being posted then the quantity to invoice must have had a value other than zero in the sales order the same goes for shipping.
If lines you did not want to ship was shipped it can only happen if the quantity to ship is larger than zero on the sales line.
Show how do the sales lines look after you have set the quantity but before you do the post?
I hope this make sense to you ?
Hi Inge M. Bruvik
Happy New Year!
I tried what you suggested but I guess there is some issue.
When I did step1 and then step3 the whole order was posted and moved to the Sales Invoice section. but I fulfilled only 1 article out of 2. but this is not a Partial Fulfillment CASE
and for following which API would you suggest for the POSTING, I used this API => /companies({company_id})/salesOrders({salesOrder_id})/Microsoft.NAV.shipAndInvoice
Hi again,
I understand your confusion because i was using the field names that you see in the Business Central GUI and not the field names that is used in the api.
So the quantity field in the API is the ordered quantity - like the quantity the customer ordered.
"invoiceQuantity": "decimal",
"shipQuantity": "decimal",
These are the fields that you will use to set the quantity you want to ship and the quantity you want to invoice in this posting. So you set those fields and then you do the posting.
"shippedQuantity": "decimal",
"invoicedQuantity": "decimal",
Are updated after posting and will show the total quantity shipped and total quantity invoiced. And the numbers you find in these two fields can be the result of one or more postings.
When it comes to the shipment tracking it looks like Microsoft did not include that in any of their standard API's.
So for this we should implement a custom API. And for that we need to develop a custom API page.
https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-develop-custom-api
Here is a code sample for how you can implement that custom api in Business Central
Hi Inge M. Bruvik
Thanks for the detailed explanation. Really appreciate your time
Can you please check these :)
For the 3rd query: You suggested the following but I couldn't find any such "Package Tracking No" field or similar on the APIs (https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_salesorder_update)
, Can you please share the API reference for this "Package Tracking No" field?
from 1st query, you have suggested a couple of times already sorry I didn't get this. We have these 2 fields for Quantity, can you please tell which is qty. to ship field you were referencing is it quantity (If I am not wrong this is the ordered Quantity we shouldn't set this?) or shipQuantity? (https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/api/dynamics_salesorderline_update)
Update all the lines you want to ship with the qty. to ship
I will try to be be a bit clearer then.
The process of creating a shipment in Business Central is a two step process..
First you have to set the qty. you want to ship on the Sales order lines you want to ship. For that purpose you use the field "Qty. to ship".
In order to do perform the actual shipment you have to do an action called "Post" that process will draw the items from your inventory, create a posted shipment document in Business Central and it will update the Qty. shipped field on your sales lines. You can not update the Qty. shipped field on your sales lines directly. That update is a system process that is done as a result of you posting the shipment.
And for doing the "post" action you have to use the bound action SHIPANDINVOICE that i mentioned in the previous post.
So in your scenarios the steps you have to go through is:
1) Partial
2) full order
3) Tracking information
So it is important to understand that you can not update the shipped qty directly on the sales line. You need to do the post action to actually fulfill your shipment in Business Central.
Did that make it any clearer?
I am sorry i did not find any good complete examples to share with you that shows you the steps in code.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156