This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Retrieving Contract and PO related items with the API?

We have a need to create reports that combine data from Contracts and their related Purchase Orders.  We aren't able to get this natively in SWSD, so we have been trying to pull the data down with the API and build a report based on that.  We're running into a wall in that both Contracts and Purchase Orders don't seem to list their related items in the returned JSON.

Is there a way to get the POs related to a Contract or vice versa using the objects returned from the API? It would save us hours of manually combing through data every month to be able to access the related IDs.

Parents
  • I couldn't find any documentation on this so I went digging until I found how it's being managed in their own UI.  Leaving the answer here in case anyone else ends up needing this info.

    Purchase Orders related to a Contract:

    purchase_orders.json?report_id=-1&amp=&related=${contract.Id}&related_type=Contracts::${contract.Type}



    Contracts related to a Purchase Order:

    contracts.json?related=${po.Id}&related_type=PurchaseOrder

Reply
  • I couldn't find any documentation on this so I went digging until I found how it's being managed in their own UI.  Leaving the answer here in case anyone else ends up needing this info.

    Purchase Orders related to a Contract:

    purchase_orders.json?report_id=-1&amp=&related=${contract.Id}&related_type=Contracts::${contract.Type}



    Contracts related to a Purchase Order:

    contracts.json?related=${po.Id}&related_type=PurchaseOrder

Children
No Data