web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Need help to finish my web service to create transfer orders using API

(0) ShareShare
ReportReport
Posted on by 9
Hi, i am pretty new to AL programming language and i managed somehow to create a web service in business central to create new transfer orders using python, i can create transfer orders and add items to be transfered to it but i can't figure out how to post the transfer order so it will go to next stage (shipping, etc) using the API. The equivalent of pushing this button:
 ////
 
Here are the code for the 2 web services i use:
  1.  Page.TransferOrderService.al: 
    page 50119 /Transfer Order Service/{    PageType = API;    Caption = 'Transfer Order Service';    APIPublisher = 'EthanSorenson';    APIGroup = 'groupName';    APIVersion = 'v2.0';    EntityName = 'TransferOrderService';    EntitySetName = 'TransferOrderService';    SourceTable = /Transfer Header/;    DelayedInsert = true;    layout    {        area(Content)        {            group(General)            {                field(/No/; Rec./No./)                {                }                field(/TransferFromCode/; Rec./Transfer-from Code/)                {                }                field(/TransferToCode/; Rec./Transfer-to Code/)                {                }                field(/DirectTransfer/; Rec./Direct Transfer/)                {                }                field(/InTransitCode/; Rec./In-Transit Code/)                {                }                field(/PostingDate/; Rec./Posting Date/)                {                }                field(/ShortcutDimension1Code/; Rec./Shortcut Dimension 1 Code/)                {                }                field(/ShortcutDimension2Code/; Rec./Shortcut Dimension 2 Code/)                {                }                field(/AssignedUserID/; Rec./Assigned User ID/)                {                }                field(Status; Rec.Status)                {                }            }            group(Shipment)            {                field(/ShipmentDate/; Rec./Shipment Date/)                {                }                field(/OutboundWhseHandlingTime/; Rec./Outbound Whse. Handling Time/)                {                }                field(/ShipmentMethodCode/; Rec./Shipment Method Code/)                {                }                field(/ShippingAgentCode/; Rec./Shipping Agent Code/)                {                }                field(/ShippingAgentServiceCode/; Rec./Shipping Agent Service Code/)                {                }                field(/ShippingTime/; Rec./Shipping Time/)                {                }                field(/ShippingAdvice/; Rec./Shipping Advice/)                {                }                field(/ReceiptDate/; Rec./Receipt Date/)                {                }            }            group(/Transfer-from/)            {                field(/TransferFromName/; Rec./Transfer-from Name/)                {                }                field(/TransferFromName2/; Rec./Transfer-from Name 2/)                {                }                field(/TransferFromAddress/; Rec./Transfer-from Address/)                {                }                field(/TransferFromAddress2/; Rec./Transfer-from Address 2/)                {                }                field(/TransferFromCity/; Rec./Transfer-from City/)                {                }                group(Control17)                {                    field(/TransferFromCounty/; Rec./Transfer-from County/)                    {                    }                }                field(/TransferFromPostCode/; Rec./Transfer-from Post Code/)                {                }                field(/TrsfFromCountryRegionCode/; Rec./Trsf.-from Country/Region Code/)                {                }                field(/TransferFromContact/; Rec./Transfer-from Contact/)                {                }            }            group(/Transfer-to/)            {                field(/TransferToName/; Rec./Transfer-to Name/)                {                }                field(/TransferToName2/; Rec./Transfer-to Name 2/)                {                }                field(/TransferToAddress/; Rec./Transfer-to Address/)                {                }                field(/TransferToAddress2/; Rec./Transfer-to Address 2/)                {                }                field(/TransferToCity/; Rec./Transfer-to City/)                {                }                group(Control24)                {                    field(/TransferToCounty/; Rec./Transfer-to County/)                    {                    }                }                field(/TransferToPostCode/; Rec./Transfer-to Post Code/)                {                }                field(/TrsfToCountryRegionCode/; Rec./Trsf.-to Country/Region Code/)                {                }                field(/TransferToContact/; Rec./Transfer-to Contact/)                {                }            }            group(Control19)            {                field(/InboundWhseHandlingTime/; Rec./Inbound Whse. Handling Time/)                {                }            }            group(/Foreign Trade/)            {                field(/TransactionType/; Rec./Transaction Type/)                {                }                field(/TransactionSpecification/; Rec./Transaction Specification/)                {                }                field(/TransportMethod/; Rec./Transport Method/)                {                }                field(/Area/; Rec.Area)                {                }                field(/EntryExitPoint/; Rec./Entry/Exit Point/)                {                }                part(TransferLines; /Transfer Order Subform/)                {                    EntityName = 'TransferOrderLineService';                    EntitySetName = 'TransferOrderLineService';                }            }        }    }}
     
  2. Page.TransferLineService.al:
    page 50118 /Transfer Line Service/{    APIGroup = 'apiGroup';    APIPublisher = 'JeromeC';    APIVersion = 'v2.0';    ApplicationArea = All;    Caption = 'Transfer Line Service';    DelayedInsert = true;    EntityName = 'TransferLineService';    EntitySetName = 'TransferLineService';    PageType = API;    SourceTable = /Transfer Line/;    layout    {        area(content)        {            repeater(General)            {                field(documentNo; Rec./Document No./)                {                    Caption = 'Document No.';                }                field(itemNo; Rec./Item No./)                {                    Caption = 'Item No.';                }                field(quantity; Rec.Quantity)                {                    Caption = 'Quantity';                }                field(qtyToShip; Rec./Qty. to Ship/)                {                    Caption = 'Qty. to Ship';                }                field(status; Rec.Status)                {                    Caption = 'Status';                }            }        }    }}
    Note: the first one is not from me, credit to the author here: ethan-sorenson/TransferOrderService: Web Service for Transfer Orders (github.com)
 
Basically the first service create the transfer order and the other one add items to it. All is missing now is a way to post the order, can someone help me ? Thanks in advance !
I have the same question (0)
  • Abdul Mateen Profile Picture
    36 on at
    ​​​​​​​
  • Verified answer
    LunatikDev Profile Picture
    9 on at

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,055 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,063 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 1,014 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans