You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

[ |../../index.htm#lansa/lansa050_1390.htm]
現在地: RAMP-TSガイド > プログラミング・テクニック > HIDE_CURRENT_FORM を使用したコマンド・ハンドラー・タブのアクセス管理

HIDE_CURRENT_FORM を使用したコマンド・ハンドラー・タブのアクセス管理

このシナリオでは、RAMP アプリケーションは受注処理システムの上に作成されています。
一部のコマンド・ハンドラー・タブ (および基となる 5250 デスティネーション・スクリプト) では、ユーザーがキャンセルまたは完了した注文に関して、アクションが実行できないようにする必要があったとしましょう。   
ステップ 1 - 各インスタンス・リストのエントリーに「コード」や「ステータス」などの列を挿入
ここでは、フィールド #ORDSTATUS が、インスタンス・リストの列 Acolumn9() にマッピングされています。
値には、「CAN」(キャンセル済み)、「OPN」(開いている)、「WIP」(作業中)、または「COM」(完了)があります。    
  
Invoke Method(#avListManager.AddtoList) Visualid1(#OrdNo) Visualid2(#CustlName) Akey1(#OrderNumber) AColumn9(#ORDSTATUS)
  
注: AColumn9() は、期待通りにユーザーに表示されたり、されなかったりします。
  
ステップ 2 - 該当のスクリプトに確認コードを挿入
ここで、注文を変更する 5250 画面のスクリプトでは、キャンセルされた注文または完了した注文を表示しないよう追加確認が行われています。
/* Get the order status from additional column 9 in the current order instance list entry */
 
var ORDSTATUS = objListManager.AColumn9[0];
/* If the order is cancelled or closed, prevent the 5250 screen from being displayed, and show a message as to why */
 
if ((ORDSTATUS == "CAN") || (ORDSTATUS == "COM"))
{
   HIDE_CURRENT_FORM("Sorry, but you are not allowed to display this order because it is cancelled or completed.");
   return;
}
/* If we reach here then it's okay to proceed to the order display screen */
 
 
< その他の処理 >
< その他の処理 >
  
HIDE_CURRENT_FORM("message") ファンクションにより、コマンド・タブに表示されている現在の 5250 画面が表示されなくなり、代わりにタブの中央に 「Sorry, but you are not allowed to display this order because it is cancelled or completed. (キャンセルまたは完了の注文は表示できません)」 というメッセージが表示されます。
AColumn9 の内容 (「CAN」、「OPN」、「WIP」、「COM」) は、スクリプトの任意の場所で使用して、ユーザーのアクティビティを制限または制御できます。       
[ |../../index.htm#lansa/lansa050_1390.htm]

  • No labels