I am working on developing an API call that will allow me to insert data into a custom field that was made on the Sales Order page by utilizing AL Extensions. The problem is that whenever I attempt to make the API call using postman, I receive the error message "The Property "propertyName" does not exist on type 'Microsoft.NAV.salesOrder'." To begin, I'm not even sure if the application programming interface (API) supports this, so I'm not even sure if it's even possible. And secondly, is there a specific way to set up the API call or the Field through the AL Extension if it is even possible to do so?
tableextension 50100 "AddProjectIdToSalesOrder" extends "Sales Header"
{
fields
{
field(50100; "CrmProjectId"; Guid)
{
Caption = 'Crm Project Id';
DataClassification = OrganizationIdentifiableInformation;
}
}
}
pageextension 50100 "AddProjectIdToSalesOrder" extends "Sales Order"
{
layout
{
addlast(General)
{
field("CRM Project Id"; Rec.CrmProjectId)
{
ApplicationArea = all;
ToolTip = 'The Guid of the related Project Record in the CRM environment';
}
}
}
}
I'm setting up the field with the AL extension in the manner described below, and for the post call, I'm just making a fresh Sales Order with a post, and the body is as follows:
{
"customerNumber" : "10000",
"CrmProjectId" : "random-guid"
}
And the mistake is "Bad Request: "Type 'Microsoft.NAV.salesOrder' does not contain the property 'CrmProjectId'. Be careful to only use property names that the type defines." We would appreciate any assistance.
For more information-
https://archerpoint.com/adding-field-extension-microsoft-dynamics-business-central-or-nav/