Announcements
Hello, I am working on a program that would automatically update the Production Journal for our production orders. Right now I'm trying to get the production journal lines for the production order via ODataV4 (as below), but I am having trouble.
I've created a web service, but when I use it, the results are empty. The web service looks like this:
Response I get:
{
"@odata.context": myURL,
"value": []
}
I believe you have to specify a journal in order to get journal lines, which may be the cause of the problem. I've tried to rectify this by adding ?$filter=xx like so myURL?$filter=Order_No. eq 'ORDERNUMBER' using this page but I just get an error in the response.
I've also tried tried to use the API to get the journal lines using this page. But it says you need to have the journal ID in the URL, I can't figure out what that should be. I've tried putting in the ID of the production order, the name of the production order, doesn't work.
If anyone has ideas I would love to hear them, I'm having a tough time with this. Thanks!
I’m pretty sure the production journal only exists temporarily while you have it open in BC.
I think you’ll find this requirement more easily met by writing to the output and consumption journals.
I did this video a while ago which might go along with the other you have found: https://youtu.be/6VUNCVKCwM4
The easiest way to create an api page is to install a vs code extension called AZ AL. It has a wizard based method for creating objects. You just fill in the unique pieces of info. At the time of the video the v1 standard api didn’t include the contact table so I use a none custom table in that scenario
JAngle Robert Jolliffe Thank you for your replies. Yes I am working on a shop-floor application that we can use to update BC with the current status of our production orders. I realized I was having trouble finding the right table where the progress is tracked, once I found it I made a web service and can get the data from it.
Now my task is to POST new lines to it, so I am going to use your advice and try to make a custom API to do that. This is my first time doing it, do you have any advice for learning to do it? Here is a video I'm working with right now https://www.youtube.com/watch?v=dp_mzqzNvPA. I assume I do not need to create a custom table, just a new page with 'source table' set to the table I want to update (Capacity Ledger Entry). Thanks!
With the odata page use the journal template and batch as filters. The primary key fields need satisfying for it to pick up your data. The api page is purely for financial journals so that is no good to you.
I agree with the latest remark that a custom query/page is often the best way so you can use the information in a variety of paths in an optimised way. I’ve previously completed your scenario by doing just that.
I'd probably try creating a new, very simple page for this and publishing that page instead of the standard one. You want a page that when you run it "pops open" without any prompts before. I believe this page requires you to pick a batch first.
Creating a page in AL that defaults to a batch would make it much easier to do this.
I assume you want to use a Power App or a custom application to collect data from the shop floor and push it into BC with web services? It might also make sense to write a SOAP web service function in a Code Unit that you call and pass the information into, which then checks to make sure it's all correct and sends back a simple error code.
Not sure if that helps.
-Rob
André Arnaud de Cal...
294,017
Super User 2025 Season 1
Martin Dráb
232,852
Most Valuable Professional
nmaenpaa
101,158
Moderator