2017-09-26 6 views
0

一部のユーザフィールドが、ARInvoiceエントリ画面(AR301000)の最上位フォームに追加されました。インボイスがリリースされた後、特定のユーザテキストフィールドを変更したい場合、これを達成するための最良の方法は何ですか? ARInvoice入力画面についてARInvoiceのリリース後にAR301000ヘッダーでカスタムフィールドを有効にする方法はありますか?

答えて

1

、トップレベルフォームのみARInvoiceEntry BLC内に実装される特定のすべてのUIのプレゼンテーションロジック:

public class ARInvoiceEntry : ARDataEntryGraph<ARInvoiceEntry, ARInvoice>, PXImportAttribute.IPXPrepareItems 
{ 
    ... 
    protected virtual void ARInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e) 
    { 
     ARInvoice doc = e.Row as ARInvoice; 
     if (doc == null) return; 
     ... 
     bool shouldDisable = doc.Released == true 
          || doc.Voided == true 
          || doc.DocType == ARDocType.SmallCreditWO 
          || doc.PendingPPD == true 
          || doc.DocType == ARDocType.FinCharge && !IsProcessingMode && cache.GetStatus(doc) == PXEntryStatus.Inserted; 

     if (shouldDisable) 
     { 
      bool isUnreleasedWO = doc.Released != true && doc.DocType == ARDocType.SmallCreditWO; 
      bool isUnreleasedPPD = doc.Released != true && doc.PendingPPD == true; 

      PXUIFieldAttribute.SetEnabled(cache, doc, false); 
      PXUIFieldAttribute.SetEnabled<ARInvoice.dueDate>(cache, doc, (doc.DocType != ARDocType.CreditMemo && doc.DocType != ARDocType.SmallCreditWO && doc.DocType != ARDocType.FinCharge) && doc.OpenDoc == true && doc.PendingPPD != true); 
      PXUIFieldAttribute.SetEnabled<ARInvoice.discDate>(cache, doc, (doc.DocType != ARDocType.CreditMemo && doc.DocType != ARDocType.SmallCreditWO && doc.DocType != ARDocType.FinCharge) && doc.OpenDoc == true && doc.PendingPPD != true); 
      PXUIFieldAttribute.SetEnabled<ARInvoice.emailed>(cache, doc, true); 
      cache.AllowDelete = isUnreleasedWO || isUnreleasedPPD; 
      cache.AllowUpdate = true; 
      Transactions.Cache.AllowDelete = false; 
      Transactions.Cache.AllowUpdate = false; 
      Transactions.Cache.AllowInsert = false; 

      .. 
     } 
     else 
     { 
      ... 
     } 
     ... 
    } 
    ... 
} 

後AR301000トップレベルフォームのカスタムフィールドを有効にしますARInvoiceがリリースされ、あなたはARInvoiceEntryの拡張子を宣言し、以下のサンプル次ARInvoice_RowSelectedハンドラに加入する必要があります

public class ARInvoiceEntryExt : PXGraphExtension<ARInvoiceEntry> 
{ 
    public void ARInvoice_RowSelected(PXCache sender, PXRowSelectedEventArgs e) 
    { 
     ARInvoice doc = e.Row as ARInvoice; 
     if (doc == null) return; 

     bool shouldDisable = doc.Released == true || doc.Voided == true || 
      doc.DocType == ARDocType.SmallCreditWO || doc.PendingPPD == true || doc.DocType == ARDocType.FinCharge 
      && !Base.IsProcessingMode && sender.GetStatus(doc) == PXEntryStatus.Inserted; 

     if (shouldDisable) 
     { 
      PXUIFieldAttribute.SetEnabled<ARInvoiceExt.usrCustomTextField>(sender, doc, true); 
     } 
    } 
} 

enter image description here

関連する問題