2016-11-25 18 views
0

顧客番号を受け入れて、各注文およびアイテムの詳細をエディタウィジェットに出力します。 ここで、顧客、注文、注文行および明細はテーブル名です。 ここで、顧客テーブルと受注テーブルには共通項目としてcust-numがあり、受注と受注明細(テーブル名)と受注は共通項目として受注番号を持ち、受注明細と項目は共通項目として項目番号を持ちます。 これで、cust-numを取得し、検索ボタン(オブジェクト名としてsearch1)を使用して対応するフィールドを検索し、それらをエディタウィジェット(editor-1)に表示するために、塗りつぶし(f1はオブジェクト名)を使用する必要があります。オブジェクト名)。進捗状況を使用してエディタウィジェットのテーブルからフィールドを検索および表示する方法4gl

define temp-table ttcustomer 
field custnum like customer.cust-num 
field cname like customer.name 
field orders like order.order-num 
field items like item.item-num 
field itemname like item.item-name . 


find first customer WHERE customer.cust-num = input f1 NO-LOCK . 

    create ttcustomer . 

     assign 
     ttcustomer.custnum = customer.cust-num 
     ttcustomer.cname  = customer.name. 



    for each order WHERE Order.cust-num = input f1 NO-LOCK . 

     assign 
     ttcustomer.orders = order.order-num. 

     for each order-line where order-line.order-num = order.order-num no-lock. 


     for each item where item.item-num = order-line.item-num no-lock. 

     assign 
     ttcustomer.items = item.item-num 
     ttcustomer.itemname = item.item-name. 
     end. 
     end. 
    end. 

このコードは検索ボタンに記載されています。 エディタウィジェットで一時テーブルttcustomerを表示するにはどうすればいいですか:)

+0

[データベースを検索して、進行状況4glを使用してエディタウィジェットに結果フィールド値を表示する方法](http://stackoverflow.com/questions/40837622/after-searching-in-a-database-フィールドの値の表示方法の結果の表示方法) –

答えて

0

おそらく、エディタの代わりにブラウザを使う方がよいでしょう。しかし、あなたはエディタを使用しようとしている場合、これはあなたが必要なものを与える必要があります:あなたはあなたのような任意のレコード選択/操作を行うことができなくなりますので

DEFINE VARIABLE edData AS CHARACTER NO-UNDO. 

FOR EACH ttcustomer: 
    edData = edData + ttcustomer.items + ", " + ttcustomer.itemname + CHR(10). 
END. 

editor-1:SCREEN-VALUE = edData. 

をエディタは単なるテキストであることができ、ブラウザで。また、多くのttcustomerレコードがある場合、32k文字列サイズの上限をオーバーフローさせる危険性があります。

関連する問題