Product documentation
In This Topic
    Sourcing warehouse
    In This Topic

    Business value 

    In standard Microsoft Dynamics 365 for Finance and Operations it is possible to setup an intercompany relation between a customer of one company and a vendor of another company. When such a vendor is selected on a sales order line as sourcing vendor an intercompany purchase order is created automatically. The site and warehouse are initiated either from the customer or from the default order settings of the item.

    It is not possible to select a specific warehouse to source from when you select the sourcing vendor.

    When a company has a lot of warehouses and you want to give the sales clerk the possibility to select one an intercompany customer vendor relationship needs to be set up for each warehouse and your company which can be a cumbersome when there are a lot of companies with multiple warehouses.

    With our solution you only need to setup one intercompany relationship between each company.

    Solution

    When selling goods to a customer and you notice there is not enough stock, it's possible to source from an another company by selecting the sourcing vendor (which in this case represents the other company). However it is not possible to select a specific warehouse to source from as in standard Microsoft Dynamics 365 for Finance and Operations when an intercompany sales order is created the warehouse on the order line of that order is determined by the default order settings on the item or if empty based on the warehouse of the sales order header which is set based on the default warehouse of the customer.

    There is a work around for this by setting up a default warehouse on the intercompany customer, but it assumes that there is no default warehouse setup on the item. Also when there are many company and warehouses to source from you have to setup a lot of intercompany relations, one per company warehouse, which makes it very cumber some to maintain.

    Select sourcing warehouse on sales order line manually

    To overcome this limitation and to make it easier, within Inventory Insights on the Sourcing tab of the sales order the field Sourcing warehouse has been added. The lookup of this field will show all warehouses of the company for which an intercompany relation ship with the current company has been setup.

    As soon as warehouse is selected the sourcing vendor of this relation ship is populated and an intercompany purchase order is created (on save).

    Set sourcing warehouse on sale order line via Odata action

    Microsoft recently launched the Intelligent Order Management solution. Within this app which is build on top of the PowerPlatform it will be possible to look at stock of multiple companies and use Distributed Order Management logic to decide from where to full fill orders. Currently the solution does not provide a solution to automatically create inter company orders within Microsoft Dynamics 365 for Finance and Operations.

    For that reason we have added the possiblity to set the Sourcing warehouse on the sales order line via an Odata action. This action can be called from within the PowerPlatform which makes it possible to use it from within Intelligent Order Management.

    A new data entity DYSLHISalesLineSourcings with the action setSourcingWarehouse has been added to support this.

    The process could look like this:

    1. Sales order line with saleslotId 002816 for item 0001 from company USMF is created and send to Intelligent Order Management
    2. Intelligent Order Management determines that the best sourcing location is warehouse ANNARBO in USRT and triggers a flow
    3. This flow will call the the action SetSourcingWarehouse which needs the following variables:
      • _salesLotId = 002816
      • _salesLineCompanyId = USMF
      • _sourcingWarehouse = ANNARBO
      • _sourcingCompany = USRT

    With this method you can set, change and clear the value of the field Sourcing Location.

    Set

    Post url/data/DYSLHISalesLineSourcings/Microsoft.Dynamics.DataEntities.setSourcingWarehouse

    {
        "_salesLotId":"002816",
        "_salesLineCompanyId":"DEMF",
        "_sourcingWarehouse":"ANNAPOL",
        "_sourcingCompany":"USRT"
    }

    Response

    {
        "Vendor": "7001",
        "Message": "Created purchase order 001771 for vendor 7001",
        "dataAreaId": "DEMF",
        "Success": "Yes",
        "PurchaseOrder": "001771"

    }

    When sending the same request for the second time:

    Response

    {
        "Vendor": "7001",
        "Message": "Nothing to update",
        "dataAreaId": "DEMF",
        "Success": "Yes",
        "PurchaseOrder": ""

    }

    Update

    Post url/data/DYSLHISalesLineSourcings/Microsoft.Dynamics.DataEntities.setSourcingWarehouse

    {
        "_salesLotId":"002816",
        "_salesLineCompanyId":"DEMF",
        "_sourcingWarehouse":"HOUSTON",
        "_sourcingCompany":"USRT"
    }

    Response

    {
        "Vendor": "7001",
        "Message": "Created purchase order 001772 for vendor 7001",
        "dataAreaId": "DEMF",
        "Success": "Yes",
        "PurchaseOrder": "001771"

    }

    Clear

    Post url/data/DYSLHISalesLineSourcings/Microsoft.Dynamics.DataEntities.setSourcingWarehouse

    {
        "_salesLotId":"002816",
        "_salesLineCompanyId":"DEMF",
        "_sourcingWarehouse":"",
        "_sourcingCompany":""
    }

    Response

    {
        "Vendor": "7001",
        "Message": "Removed link between purchase order 001793 for vendor 7001",
        "dataAreaId": "DEMF",
        "Success": "Yes",
        "PurchaseOrder": "001771"
    }

    Setup

    By default this feature is turned off. Go to System administration > Setup > License configuration > configuration key Inventory Insights and enable sub configuration key Sourcing warehouse selection

    Within the current company, create an intercompany vendor per legal entity.

    Go to the Trading relation ship tab of the intercompany settings and activate the field Primary sourcing relation

    Max one combination of companies can be marked primary, for this relation it will show all the warehouses in the lookup of the sourcing warehouse on the sales order line.