SDK - Accessing Records, Locations, Spaces and Schedules from their Barcode

  • KM506465
  • 20-Sep-2008
  • 20-Sep-2008

Archived Content: This information is no longer maintained and is provided "as is" for your convenience.


Return to SDK Samples

Accessing Records, Locations, Spaces and Schedules from their Barcode

It is now possible to access these objects with the Get<Object> method of the database passing their Barcode as a searchstring. TRIM barcodes have the format - the following is a Record from the DemoDB with URI of 17

Object identifier Database ID URI (base 36 padded with zero’s to seven digits)
R 45 000000h

Object Type Object identifier
Record R
Location L
Schedule A
Space X

The Get<object> searchstring has the format “BARCODE:”<Internal or External Barcode to search for> as illustrated below.

' Record
    Dim p_rec As Record
    'Foreign Barcode
    'Set p_rec = m_db.GetRecord("BARCODE:1234567890")
    ' or
    'Internal Barcode - R denotes Record
    Set p_rec = m_db.GetRecord("BARCODE:R450000006")
    If Not p_rec Is Nothing Then
        Debug.Print p_rec.Number
    End If
    Dim p_loc As Location
    'Foreign Barcode
    'Set p_loc = m_db.GetLocation("BARCODE:L0001")
    ' or
    'Internal Barcode - L denotes Location
    Set p_loc = m_db.GetLocation("BARCODE:L450000006")
    If Not p_loc Is Nothing Then
        Debug.Print p_loc.SortName
    End If
' Schedule
    Dim p_sched As Schedule
    'Internal Barcode - A denotes Schedule
    Set p_sched = m_db.GetSchedule("BARCODE:A450000006")
    If Not p_sched Is Nothing Then
        Debug.Print p_sched.Name       
    End If
' Space
    Dim p_space As Space
    'Foreign Barcode
    'Set p_space = m_db.GetSpace("BARCODE:S0001")
    ' or
    'Internal Barcode - X denotes Space
    Set p_space = m_db.GetSpace("BARCODE:X450000006")
    If Not p_space Is Nothing Then
        Debug.Print p_space.FullDescription        
    End If