Integration
API Objects¶
The following APIs are available within API Group statusmanagement with API publisher apportunix.
Item API¶
The Item API is published with the following identifiers:
| Property | Value |
|---|---|
| API publisher | apportunix |
| API group | statusmanagement |
| API version | v1.0 |
| Entity set | items |
| Entity | item |
| OData key | id (SystemId) |
The API page is read-only. To change an item's status, call the bound ChangeStatus action instead of updating the status field directly.
Read item statuses¶
Use the standard Business Central API endpoint:
GET {businessCentralBaseUrl}/api/apportunix/statusmanagement/v1.0/companies({companyId})/items
For example, retrieve a single item by its system ID:
GET {businessCentralBaseUrl}/api/apportunix/statusmanagement/v1.0/companies({companyId})/items({itemId})
The response includes these fields:
| Field | Description |
|---|---|
id |
The item's Business Central system ID. Use this value to address the item and invoke the status action. |
no |
The item number. |
status |
The current Status Management status code. |
statusDesc |
The description of the current status. |
lastModifiedDateTime |
The date and time at which the item was last modified. |
You can apply the usual OData query options. For example:
GET {businessCentralBaseUrl}/api/apportunix/statusmanagement/v1.0/companies({companyId})/items?$select=id,no,status,statusDesc,lastModifiedDateTime&$filter=no eq '1000'
Change an item's status¶
Invoke the ChangeStatus action on the item and pass the target Status Management status code in newStatusCode:
POST {businessCentralBaseUrl}/api/apportunix/statusmanagement/v1.0/companies({companyId})/items({itemId})/Microsoft.NAV.ChangeStatus
Content-Type: application/json
Authorization: Bearer {accessToken}
{
"newStatusCode": "RELEASED"
}
Replace RELEASED with the status code configured in Status Management. The value has a maximum length of 10 characters.
The action processes the change through Status Management. This means that the configured status rules still apply, including:
- the target status must exist;
- the required Status Management permissions must be available;
- mandatory fields for the target status must be filled in;
- the status change is added to the Status Management log;
- when the status actually changes, the external Status change business event is raised.
If the action succeeds, Business Central returns an updated action result for the item. If validation fails, the API call returns the corresponding Business Central error.
Note
An active Apportunix Status Management subscription is required when opening and using this API page.
Power Platform integration¶
External business event: Status change¶
In Power Automate, use the Business Central connector's business-event trigger and select:
- Event:
Status change - Publisher: Apportunix
- Version:
1.0
The event is triggered after a record's status has actually changed. It can therefore be used to notify another system, start an approval or follow-up process, or synchronize the resulting status change.
The event provides these parameters:
| Parameter | Type | Description |
|---|---|---|
tableId |
Integer | The Business Central table ID of the changed record. |
systemId |
GUID | The system ID of the changed record. Use it to retrieve the record through an appropriate API. |
appliesToType |
Integer | Identifies the type of record to which Status Management applies. See the ordinal values below. |
action |
Integer | Identifies the Status Management action that caused the change. See the ordinal values below. |
oldStatusCode |
Code[10] | The status code before the change. |
newStatusCode |
Code[10] | The status code after the change. |
Applies-to type values¶
| Value | Name |
|---|---|
0 |
Item |
1 |
Sales |
2 |
Purchase |
3 |
Customer |
4 |
Vendor |
5 |
Project |
6 |
Service |
Status action values¶
| Value | Name |
|---|---|
0 |
None |
1 |
Init |
2 |
Previous |
3 |
Next |
4 |
Edit |
[!IMPORTANT] The
appliesToTypeandactionparameters are deliberately exposed as integer ordinal values, not as enum or option text. When Business Central exposes enum or option parameters as text, it can use the translated caption instead of the stable enum member name. That output can change with the user's language and may break a Power Automate flow or another connected application. Always compare these parameters with the numeric values listed above.
For example, use an integer comparison in a Power Automate condition:
appliesToType is equal to 0
This condition identifies an Item status change independently of the Business Central user's language.
Example event handling flow¶
A typical Power Automate flow can use the event as follows:
- Trigger the flow when the Status change business event occurs.
- Check
appliesToTypeto determine the record type. - Check
action,oldStatusCode, ornewStatusCodeto decide whether the flow should continue. - Use
tableIdandsystemIdto identify or retrieve the changed record. - Perform the required follow-up action.
For example, to process items that were explicitly changed to status RELEASED, check that:
appliesToType = 0
and action = 4
and newStatusCode = 'RELEASED'