Breadcrumbs

External Messages - Send Data from BC to MES


Data from Wisefish and Business Central can be sent to the MES system as XML documents via service bus messages through Azure. This can be used to send …

  • sales orders that items need to be produced for. This has been implemented for Delivery Agreements in Wisefish.

  • master data like Items, Customers and Vendors can be sent from Change Log


Setup

The setup is done on the following pages in Wisefish:

  • Wisefish APIs Base & Setup has some basic settings to active this functionality.

  • The Stock Centers that stand for for the production factories get their own service bus queue.

  • External Message Setup has the list of tables that are sent

  • For each table, the fields to be sent are selected in the list External Message Fields


Wisefish APIs Base & Setup

On the page “Wisefish APIs Base & Setup there are fields required for this functionality.

image-20260202-135509.png

Field

Description


Service Bus URL

The service bus message URL. Then for each stock center an additional setting is required. See below.


Send at Delivery Agreement Release

Selecting this option, will send a message on every release.


To be obsoleted

Sending Sales Orders (Del. Agr.) to MES

This button controls how released Delivery Agreements are sent as sales orders to the external manufacturing system (MES). Options are:

  • Manual : No orders are sent automatically. User will send with the button on the Delivery Agreement card.

  • Send once at release : When the agreement is released, the message is sent. If sent successfully, it will not be sent again, even if document is re-opened and released.

  • At release until in process : At every release, the message is sent, until the status on the agreement card is changed to “In process at MES


Resending Order Allowed

A checkmark in this fields allows the user to resend orders which have status “Sent to MES”. This can be done in either

  • manually for a single DA from the card

  • from the list with a specific method to resend orders


Stock Center

Then for each stock center that needs to send messages to external production systems then a service bus queue needs to be configured as well as the connection information and authentication for it.

These fields are in a new tab at the bottom of the Stock Center page:

image-20251223-133935.png

Example:

The SAS token looks like this:

SharedAccessSignature sr=https%3A%2F%2FWiseFishEPSubscribeDev.servicebus.windows.net%2Fsomequeue&sig=0bDte%2FbvqCTl9CRGv2Z4G8wjsahF0BZ6Vhyg0xKgN8I%3D&se=2397206944&skn=BCIntegrationSend


External Message Setup

Under the Wisefish APIs setup page there is a button to open the External Message Setup.

image-20260202-140206.png

This opens a list of all defined message types, where each of them is related to a single table in the database.

image-20260202-140238.png
Example of defined message types

Sales Order message for a Delivery Agreement is directly linked to the “Sales Agreement Header” table which is the table behind the header. But for it to work it needs a setup for all the following tables:

  • Sales Agreement Header

  • Sales Agreement Line

  • Customer

  • Item

External Message Fields

Drilling down from field No. of Fields will open up the field selection for that specific table.

Field

Description

Node Name

This value will be used as a node name in the XML file

Field ID

This is the ID of the field in the table in BC. This should be left blank if the node shall contain a fixed value, instead of a field value.

Field Name

Shows the name of the field selected with the Field ID.

Fixed Value

If there is no Field ID, the fixed value is typed into this field.

Disabled

Checkmark in this field will disable it, so it is not included in the XML file.


Example

On the snapshot below, the Item table number 27 has 5 fields configured for xml:

image-20251223-134633.png
An example of fields sent for Item

This list defines the XML node names and then you select the field ID from the Item Table, so for the first line we have configured the field No. to be a part of the XML but it should be named “Code” in the XML file. You can also add non table bound fields like the field SystemType that is just the entered value 1800.

This configuration will produce the following XML for one entry in the table:

    <Object DataType="Marel.Mp6.Process.Materials.MaterialRecord">
      <Properties>
        <Code>HSS1-0405</Code>
        <Name>Salmon Fresh HOG Superior 4-5kg</Name>
        <Active>1</Active>
        <SystemType>1800</SystemType>
        <PalletPSize>30</PalletPSize>
      </Properties>
    </Object>



Sending sales orders to MES

Currently the sending of sales orders (Delivery Agreements) can be automated in the system.
This is described in chapter Send Sales Orders (DAs) to MES



Sending data from Change Log

On the base card, the APIs change log can be activated for specific records:

image-20260129-120006.png

When changes have been done on these table, entries will exist in the APIs Change Log. From this lists, messages can be sent for each entry.

image-20251223-135349.png

The list can also be used to resend them, or for testing purposes, i.e. just view the content of the message that would be sent.

When resending a message, it will contain data from the field values as they are now, since the system is not keeping a copy of the old values of the data fields.


From the Change Log entries, click button XXXX to send messages for the selected entries to the MES system.



Sending Master Data to MES

In current version it is only possibly to send the masterdata directly from the Change Log.