Hy everyone,
I've got 2 tables : Customer and Order and I'm trying to populate a DatagridView with 2 columns which match Customer.maj_user and Order.maj_user.
Here is the code :
DEF TEMP-TABLE ttCust
FIELD CustomerID LIKE Customer.CustomerID
FIELD maj_user_customer LIKE Customer.maj_user
FIELD OrderID LIKE Order.OrderID
FIELD maj_user_order LIKE Order.maj_user.
DEFINE QUERY qCust FOR CUSTOMER, ORDER.
DEFINE DATA-SOURCE srcCustomer FOR QUERY qCust.
DEFINE DATASET dsCust FOR ttCust.
DEF VAR hqCust as handle.
hqCust = QUERY qCust:HANDLE.
hqCust:QUERY-PREPARE("FOR EACH customer NO-LOCK, FIRST order OF customer NO-LOCK).
BUFFER ttCust:ATTACH-DATA-SOURCE(DATA-SOURCE srcCustomer:HANDLE).
DATASET dsCust:FILL().
bindingSourceCustomer:Handle = DATASET dsCust:HANDLE.
My problem is that column "maj_user_order" and "maj_user_customer" are empty
I'm a beginner with Progress GUI .NET.
I'm looking for a solution everywhere but no results
Somebody can help me?
Thank you.
The fields maj_user_customer and maj_user_order will not be filled because there are no fields with the same names in the attached data source. The ATTACH-DATA-SOURCE method has optional parameters for this. Your data source apparently has two maj_user fields, so you will need to qualify the reference for each mapping.
buffer ttCust:attach-data-source(data-source srcCustomer:handle,"maj_user_customer,Customer.maj_user,maj_user_order,Order.maj_user").