Skip to Content
avatar image
Former Member

Business One Service Layer expand flexibility

Are there any plans for creating more flexibility in the expand options of the entities?

For example I would like to have a description in the Production Order Rows. In Sap Business One the Item description is shown, and the linetext in the row is null.

As far as I can see, I can only achieve this by retrieving the Production Orders. And than in separate calls retrieve the items that where in the Production Order Lines, and retrieve the Item description.

I would much rather have one call where I expand the ProductionOrder with the ProductionOrderLine/Item.

I hope you enrich the Service Layer in such a way that every related entity could be retrieved via the expand option, to give us optimal flexibility. :-)

On that subject is there a specific reason that the ProductOrderLines are default expanded? And not optional via Expand?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Feb 05, 2018 at 09:47 AM

    Hi Mark,

    Can we have some screenshots which describes the issue in detail?

    Kind regards,


    SAP SME Support

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 15, 2018 at 10:42 AM

    Giving screenshots for a background service is somewhat difficult, but here goes.

    When in the Sap B1 client I open the Production Order module and see the following screen.

    For my application I want a lot of this information, but I also want the information given with the red arrows.
    Like the Item Description, and the UoM Name.

    Now as a form of debug I use my rest client (Paw) to connect to the Service Layer.

    I request the ProductionOrders filtered by the order you see above. And expand it with the UnitOfMeasurement.

    Now I do get the UnitOfMeasurement of the produced item of this order (which is null for this example).
    But I do not get the UnitOfMeasurement of the items of the ProductionOrderLines down below.

    Also I only get the ItemNo in the ProductionOrder and in the Lines. And not the Descriptions I desire.

    There is a field LineText in the lines, for which I expected to have the Item Description or maybe a user deviation of that description for this order. But first I cannot find how to activate that field in Sap, second it is filled with null.

    Now I try to expand the ProductionOrderLines/UnitOfMeasurement, but I receive a Bad request error on this.

    This is to be expected because it is not stated as a navigation property in the metadata.

    As stated in my question, the issue with this is that I will have to make many calls to the Service Layer to retrieve all the information I need.
    For example:
    * call to retrieve all the orders that have a status planned or released
    * for every order retrieve the item descriptions
    * for every order retrieve the UoM names

    And sure we can make sure we do not need to retrieve an Item or UoM we have retrieved before.
    But we are hoping to have as least as possible copies of the Sap data, because by definition our data will always be behind, and we need to check te validity.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 15, 2018 at 11:17 AM

    The answer before this is my main issue.

    This answer below is in regard of my second ply and hope for the future of the Service Layer.
    Namely the point of the flexibility.

    In the second screenshot where I did receive information of the ProductionOrder I only expanded the UnitOfMeasurement.

    However I do retrieve the following expanded entities by default:
    * ProductionOrderLines
    * ProductionOrderLines/SerialNumbers
    * ProductionOrderLines/BatchNumbers

    Now I know that I can use select to only obtain the ProductionOrder header fields.
    But I have the feeling that on the inside that means that the joins to the other tables are still made, and that would be a waste of performance (how little it probably is).

    In a OData concept I would except that default the ProductionOrder entity would expect that only the ProductionOrder header will be shown. Things that can be expanded would be something like:
    * Item
    * Branch
    * UnitOfMeasurement
    * Warehouse
    * SalesOrder
    * Project
    * Customer
    * Distr. Rule
    * User
    * ProductionOrderLine
    * ProductionOrderLine/Item
    * ProductionOrderLine/UnitOfMeasurement
    * ProductionOrderLine/Warehouse
    * ProductionOrderLine/Item/ItemGroup
    * ProductionOrderLine/Item/Manufacturer
    * ProductionOrderLine/Item/Warehouse

    It's a long list, and definitely not long enough. But if SAP could create a Service Layer in which the expand option is given the power and flexibility to navigate very deep. Than that would make it a very powerful tool.

    I would be able to ask the service layer for a specific order, what order lines it has, what items are on there, and even what warehouses those items can come from (next to the one the order originally is coming from).

    This is possibly if you have the navigation points on the entities.

    I know that opening up the Service Layer like that also has dangers, because that could mean the following is also possible:

    But still I hope the Service Layer will retrieve more flexibility.

    Add comment
    10|10000 characters needed characters exceeded