機械翻訳について

ユーザーが入力したデータの検証

オーダー入力スペシャリストが購買オーダー属性に入力する購買オーダー番号に対して購買オーダーが存在するかどうかを決定する、オーダー管理拡張を作成します。

パブリック・ビュー・オブジェクトを呼び出して、Oracle Procurementからデータを取得します。

デモンストレーションを目的として、この例では、HW INTERNALなどの値をハード・コードしています。 実際の環境では、異なる変数値が必要になる場合があります。

このトピックではサンプル値を使用します。 ビジネス要件によっては、別の値が必要になる場合があります。

  1. 「設定および保守」作業領域で、タスクに移動します。

    • オファリング: オーダー管理

    • 機能領域: オーダー

    • タスク: オーダー管理拡張の管理

  2. 「オーダー管理拡張の管理」ページの「発行リクエスト」の開始時タブで、新しい拡張を作成します。

    属性

    名前

    購買オーダーの存在の確認

    説明

    オーダー入力スペシャリストが購買オーダー属性に入力する購買オーダー番号に対して購買オーダーが存在するかどうかを決定します。

  3. 定義領域で、コードを追加します。

    //Import classes for validation exceptions and messages from Oracle Trading Community Architecture.
    import oracle.apps.scm.doo.common.extensions.ValidationException;
    
    def orderType = header.getAttribute("TransactionTypeCode");
    
    //Determine whether the sales order is internal.
    if(orderType != null && orderType.contains("HW INTERNAL")) {
    
      //Determine whether the purchase order exists.
      String poNumber = header.getAttribute("CustomerPONumber");
    
      boolean poExists = false;
      if( poNumber != null ) {
    
    //Get the PVO you need to access purchase orders.
    def poPVO = context.getViewObject("oracle.apps.prc.po.publicView.PurchasingDocumentHeaderPVO");
          
    //Create the view criteria. Use where clause predicates.
    def vc = poPVO.createViewCriteria();
    def vcrow = vc.createViewCriteriaRow();
    vcrow.setAttribute("Segment1", poNumber);
         
    //Query the view object to find a matching row.
    def rowset = poPVO.findByViewCriteriaWithBindVars(vc, 1, new String [0], new String [0]);
          
    //Determine whether a matching row exists.
    poExists = rowset.hasNext();
    }
    
    //If a matching row does not exist, then the purchase order that you entered does not exist. Create a validation error and stop the sales order submit.
      if( !poExists ) {
    throw new ValidationException("ORA_MANAGE_EXTENSIONS",   "DOO_EXT_HW_INTERNAL_PO_REQD", null);
      }    
    }