Connect to Workday Data from PowerBuilder



This article demonstrates how to access Workday data from Appeon PowerBuilder using the CData ADO.NET Provider for Workday.

This article demonstrates using the CData ADO.NET Provider for Workday in PowerBuilder, showcasing the ease of use and compatibility of these standards-based controls across various platforms and development technologies that support Microsoft .NET, including Appeon PowerBuilder.

This article shows how to create a basic PowerBuilder application that uses the CData ADO.NET Provider for Workday to perform reads and writes.

  1. In a new WPF Window Application solution, add all the Visual Controls needed for the connection properties. Below is a typical connection string:

    User=myuser;Password=mypassword;Tenant=mycompany_gm1;BaseURL=https://wd3-impl-services1.workday.com;ConnectionType=WQL;InitiateOAuth=GETANDREFRESH

    To connect to Workday, users need to find the Tenant and BaseURL and then select their API type.

    Obtaining the BaseURL and Tenant

    To obtain the BaseURL and Tenant properties, log into Workday and search for "View API Clients." On this screen, you'll find the Workday REST API Endpoint, a URL that includes both the BaseURL and Tenant.

    The format of the REST API Endpoint is: https://domain.com/subdirectories/mycompany, where:

    • https://domain.com/subdirectories/ is the BaseURL.
    • mycompany (the portion of the url after the very last slash) is the Tenant.
    For example, in the REST API endpoint https://wd3-impl-services1.workday.com/ccx/api/v1/mycompany, the BaseURL is https://wd3-impl-services1.workday.com and the Tenant is mycompany.

    Using ConnectionType to Select the API

    The value you use for the ConnectionType property determines which Workday API you use. See our Community Article for more information on Workday connectivity options and best practices.

    APIConnectionType Value
    WQLWQL
    Reports as a ServiceReports
    RESTREST
    SOAPSOAP

    Authentication

    Your method of authentication depends on which API you are using.

    • WQL, Reports as a Service, REST: Use OAuth authentication.
    • SOAP: Use Basic or OAuth authentication.

    See the Help documentation for more information on configuring OAuth with Workday.

  2. Add the DataGrid control from the .NET controls.
  3. Configure the columns of the DataGrid control. Below are several columns from the Account table: <DataGrid AutoGenerateColumns="False" Margin="13,249,12,14" Name="datagrid1" TabIndex="70" ItemsSource="{Binding}"> <DataGrid.Columns> <DataGridTextColumn x:Name="idColumn" Binding="{Binding Path=Id}" Header="Id" Width="SizeToHeader" /> <DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=Worker_Reference_WID}" Header="Worker_Reference_WID" Width="SizeToHeader" /> ... </DataGrid.Columns> </DataGrid>
  4. Add a reference to the CData ADO.NET Provider for Workday assembly.

Connect the DataGrid

Once the visual elements have been configured, you can use standard ADO.NET objects like Connection, Command, and DataAdapter to populate a DataTable with the results of an SQL query:

System.Data.CData.Workday.WorkdayConnection conn conn = create System.Data.CData.Workday.WorkdayConnection(connectionString) System.Data.CData.Workday.WorkdayCommand comm comm = create System.Data.CData.Workday.WorkdayCommand(command, conn) System.Data.DataTable table table = create System.Data.DataTable System.Data.CData.Workday.WorkdayDataAdapter dataAdapter dataAdapter = create System.Data.CData.Workday.WorkdayDataAdapter(comm) dataAdapter.Fill(table) datagrid1.ItemsSource=table.DefaultView

The code above can be used to bind data from the specified query to the DataGrid.

Ready to get started?

Download a free trial of the Workday Data Provider to get started:

 Download Now

Learn more:

Workday Icon Workday ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Workday.