Related Data Sets

The related resources previously discussed all link to a single resource. However, it is possible that the current resource has a list many other linked resources of the same type. A good example is a sales order header that has one or more child details. As a convenience and additionally for guidance/performance reasons, many entity representations have additional hyperlinked relations to these data sets. These field names always end in “_set”.

Continuing the sales order header example, the order details set could be represented as the following in an order_hdr retrieve representation. Assume there are two detail line items and the “id” value of the order_hdr entity is “123”.

GET https://.../wms/lgfapi/v10/entity/order_hdr/123

{

“id”: 123,

"order_dtl_set": {

"result_count": 2,

"url": "https://.../wms/lgfapi/v10/entity/order_dtl/?order_id=123"

},

}

It’s important to note that unlike the “_id” related resources which have a retrieve style hyperlink to the specific resource, “_set” related representations use list style with query string filters in order to return a paginated list of 1 to n resource representations. Also, instead of giving the “id” and “key”, the related count is returned.

If no related resources are found for the set, the value will be “null” for JSON representations and an empty tag for XML.

If you need to query an entity to return all entities with _set value being null, then you can query it as follows:

Example: for purchase_order_hdr you can query as follows:

https//…<cloud WMS instance path>/wms/lgfapi/v10/entity/purchase_order_hdr?purchaseorderdtl__isnull=true

Example Output

The following is an example output that you will see for REST API GET operation for purchase order entity which have no details on them.

{
    "result_count": 138,
    "page_count": 6,
    "page_nbr": 1,
    "next_page": “https//… intqa.wms.ocs.oraclecloud.com:443/lgf_22a_qa/wms/lgfapi/v10/entity/purchase_order_hdr?page=2&purchaseorderdtl__isnull=true",
    "previous_page": null,
    "results": [
        {
            "id": 1176,
            "url": "https//…intqa.wms.ocs.oraclecloud.com:443/lgf_22a_qa/wms/lgfapi/v10/entity/purchase_order_hdr/1176",
            "create_user": "",
            "create_ts": "2014-04-10T12:01:48.391494+05:30",
            "mod_user": "SMALL01",
            "mod_ts": "2014-04-10T12:01:48.391494+05:30",
            "facility_id": {
                "id": 647,
                "key": "QATRN01",
                "url": "https//…intqa.wms.ocs.oraclecloud.com:443/lgf_22a_qa/wms/lgfapi/v10/entity/facility/647"
            },
            "company_id": {
                "id": 369,
                "key": "QATSTPC",
                "url": "https://...intqa.wms.ocs.oraclecloud.com:443/lgf_22a_qa/wms/lgfapi/v10/entity/company/369"
            },
            "po_nbr": "POSMA001",
            "status_id": 0,
            "ord_date": "2014-04-10",
            "ref_nbr": "1STPO",
            "po_type_id": null,
            "delivery_date": "2014-04-14",
            "vendor_id": {
                "id": 390,
                "key": "VNDR048",
                "url": "https://...intqa.wms.ocs.oraclecloud.com:443/lgf_22a_qa/wms/lgfapi/v10/entity/vendor/390"
            },
            "dept_code": "",
            "ship_date": "2014-04-15",
            "cancel_date": "2014-04-15",
            "lock_id": null,
            "cust_nbr": "",
            "cust_name": "",
            "cust_addr": "",
            "cust_addr2": "",
            "cust_addr3": "",
            "rma_nbr": "",
            "sold_to_legal_name": "",
            "cust_field_1": "PO1",
            "cust_field_2": "",
            "cust_field_3": "",
            "cust_field_4": "",
            "cust_field_5": "",
            "purchase_order_dtl_set": null
        },

Similarly, some of the other entities which contain sets and how they can be queried are as follows:

IB_shipment (all inbound shipments which have no shipment details):

https://...<cloud WMS instance path>/wms/lgfapi/v10/entity/ib_shipment?ibshipmentdtl__isnull=true

Work_order_hdr (all work order headers which have not ktis on them):

https://...<cloud WMS instance path>/wms/lgfapi/v10/entity/work_order_hdr?workorderkit__isnull=true

Work_order_kit (all kits that have no components):

https://...<cloud wms instance path>/wms/lgfapi/v10/entity/work_order_kit?workordercomponent__isnull=true

Container (for all containers that have no inventory locks on them):

https://...<cloud wms instance path>/lgfapi/v10/entity/container?containerlockxref__isnull=true

Inventory (for all inventory that have no serials associated):

https://...<cloud wms instance path>/wms/lgfapi/v10/entity/inventory?inv_serial_nbr_id__isnull=true

Order_hdr (for all order hdrs what have no order details):

https://...<cloud wms instance path>/wms/lgfapi/v10/entity/order_hdr?orderdtl__isnull=true

Order_hdr (for all order hdrs that have no order locks):

https://...<cloud wms instance path>/wms/lgfapi/v10/entity/order_hdr?orderlockxref__isnull=true