Organization Tree Data

Can you advise how I might go about extracting the following?

Companies.

For selected Company, Job Numbers and Names.

For selected, Job Numbers, Invoice Dates.

I would like to utilize this information to created cascading droplist in a custom add on I am building in VB.NET.

Please advise.

Here’s a bit of VB.NET code. The cycle dates on the job show the current billing cycle. If you need to get deeper than that you can get an InvoiceList and get the dates from it.

    ' Get a customer, or you can get a BusinessPartnerCollection to get all (or active) customers
    Dim cust As BusinessPartner = BusinessPartner.GetBusinessPartnerByName("CustomerName")


    ' Get list of jobs for customer
    Dim jobs As StockingLocationList = StockingLocationList.GetJobsites(False,
          JobTreeNodeDisplayType.Name, cust.BusinessPartnerID, Guid.Empty)

    ' Loop through jobs
    For Each job As StockingLocationListItem In jobs
        'job.CycleBeginDate
        'job.CycleEndDate
        'job.Name
        'job.Number
    Next

Hi James. No problem, just keep asking questions on this site. In general, the API follows the desktop UI, so take a look there first. The semantics may not be 100% but it’ll give you a good idea.

This site is the primary place to get API information.

If you want to see which jobs track scaffolding, you can use the code in the loop above, then check the job.TrackScaffoldTags property. If this property is true then it’s a scaffold tracking job.

To get the parent branch (or laydown) you can look at this article. You’ve already got the jobsite loaded, so just use “job.”