0

I created some Sales Orders and Sales Oredr Line on Sainbox. Sales Order I get Sales Order on Rest API (https://cs20.salesforce.com/services/data/v45.0/sobjects/Sales_Order__c/a1Jm0000001u5ttEAA) - return Sales Order data - is OK.

But i don't understand how get Sales Order Line.

I think need link /services/data/v45.0/sobjects/Sales_Order_Line__c/{ID}

but i dont know line ID.

IF i created request /services/data/v45.0/sobjects/Sales_Order_Line__c/

i get response Json

{
    "objectDescribe": {
        "activateable": false,
        "createable": true,
        "custom": true,
        "customSetting": false,
        "deletable": true,
        "deprecatedAndHidden": false,
        "feedEnabled": false,
        "hasSubtypes": false,
        "isSubtype": false,
        "keyPrefix": "a1K",
        "label": "Sales Order Line",
        "labelPlural": "Sales Order Lines",
        "layoutable": true,
        "mergeable": false,
        "mruEnabled": false,
        "name": "Sales_Order_Line__c",
        "queryable": true,
        "replicateable": true,
        "retrieveable": true,
        "searchable": true,
        "triggerable": true,
        "undeletable": true,
        "updateable": true,
        "urls": {
            "compactLayouts": "/services/data/v45.0/sobjects/Sales_Order_Line__c/describe/compactLayouts",
            "rowTemplate": "/services/data/v45.0/sobjects/Sales_Order_Line__c/{ID}",
            "approvalLayouts": "/services/data/v45.0/sobjects/Sales_Order_Line__c/describe/approvalLayouts",
            "defaultValues": "/services/data/v45.0/sobjects/Sales_Order_Line__c/defaultValues?recordTypeId&fields",
            "describe": "/services/data/v45.0/sobjects/Sales_Order_Line__c/describe",
            "quickActions": "/services/data/v45.0/sobjects/Sales_Order_Line__c/quickActions",
            "layouts": "/services/data/v45.0/sobjects/Sales_Order_Line__c/describe/layouts",
            "sobject": "/services/data/v45.0/sobjects/Sales_Order_Line__c"
        }
    },
    "recentItems": []
}

"recentItems" - is empty :(

1

/services/data/v45.0/sobjects/Sales_Order_Line__c/

This is an sObject Basic Information endpoint. It provides you with core metadata about the object type Sales_Order_Line__c, not record content.

If your external application created your Sales Order Lines, it should have their Ids from the response provided when it made the initial creation call.

If not, and your application for some reason has only the Id of the Sales Order, you can make a Query call to locate associated Sales Order Lines:

GET /v45.0/query/?q=SELECT Id FROM Sales_Order_Line__c WHERE Sales_Order__c = [ID]

modifying as appropriate to your data structure.

Alternately, you can make a call with the same sObject Rows resource you're already using, appending the name of the relationship (not the sObject name of your child records):

GET /services/data/v44.0/sobjects/Account/(an Account Id)/Contacts

returns a list of the Contacts associated with that Account.

| improve this answer | |
  • Big thanks,you really helped me. – Anton Feb 27 '19 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.