LINQ to JD Edwards Data

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
LINQ offers versatile querying capabilities within the .NET Framework (v3.0+), offering a straightforward method for programmatic data access through CData ADO.NET Data Providers. In this article, we demonstrate the use of LINQ to retrieve information from the JD Edwards Data Provider.

This article illustrates using LINQ to access tables within the JD Edwards via the CData ADO.NET Data Provider for JD Edwards. To achieve this, we will use LINQ to Entity Framework, which facilitates the generation of connections and can be seamlessly employed with any CData ADO.NET Data Providers to access data through LINQ.

See the help documentation for a guide to setting up an EF 6 project to use the provider.

  1. In a new project in Visual Studio, right-click on the project and choose to add a new item. Add an ADO.NET Entity Data Model.
  2. Choose EF Designer from Database and click Next.
  3. Add a new Data Connection, and change your data source type to "CData JD Edwards Data Source".
  4. Enter your data source connection information.

    The driver connects to JD Edwards through your Application Interface Services (AIS) Server. Set the following connection properties:

    • URL: The base HTTPS URL of your AIS Server (e.g., https://jde-ais.example.com:8300).
    • User: Your JD Edwards username.
    • Password: Your JD Edwards password.
    • Environment (optional): The JD Edwards environment to use (e.g., PD920 for production or DV920 for development). If not specified, the AIS Server's default environment is used.
    • Role (optional): The JD Edwards role for the session. If not specified, the AIS Server's default role is used.
    • DeviceName (optional): An identifier for the connecting device or application, used for auditing and logging on the AIS Server.
    • Jasserver (optional): The specific Java Application Server (JAS) instance to route requests through, useful in clustered environments.

    Choosing Which Data Is Exposed

    JD Edwards organizes tables and business views by System Code, and the driver exposes each System Code as its own schema. Use these properties to control which schemas are available:

    • DataModel: One or more ERP modules (comma-separated) whose System Codes are exposed as schemas, or All to expose every System Code in the connected instance. Defaults to FinancialManagement.
    • SystemCodes: A comma-separated list of additional System Codes to expose alongside those from DataModel (e.g., 42,43).

    When you connect, the driver sends your credentials to the AIS Server to obtain a session token and caches it. The driver requests a new token automatically before the session expires.

    Below is a typical connection string:

    URL=https://your-jde-environment-app.example.com;User=admin;Password=myPassword;
  5. Required connection properties for the data source. (QuickBooks is shown.)
  6. If saving your entity connection to App.Config, set an entity name. In this example we are setting JDEdwardsEntities as our entity connection in App.Config.
  7. Enter a model name and select any tables or views you would like to include in the model.
The available tables in the underlying data source. (QuickBooks is shown.)

Using the entity you created, you can now perform select commands. For example:


JDEdwardsEntities context = new JDEdwardsEntities();

var accountspayable.accountledgerQuery = from accountspayable.accountledger in context.AccountsPayable.AccountLedger
  select accountspayable.accountledger;

foreach (var result in accountspayable.accountledgerQuery) {
  Console.WriteLine("{0} {1} ", result.Id, result.DocumentNumber);
}

See "LINQ and Entity Framework" chapter in the help documentation for example queries of the supported LINQ.

Ready to get started?

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

 Download Now

Learn more:

JD Edwards Icon JD Edwards ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with JD Edwards data including AccountLedger, ProposalofPayment, ContractRevenueSummary, EmployeeEnrollment, RentIncreaseAmounts, and more!