2016-06-21 16 views
0

Webサービスを使用してAP請求書と調整レコードを作成していますが、DocType(「タイプ」)を設定しようとするまでは問題ありません。私が「Bill」をデフォルトにしておくと、問題はありません。明示的に 'Bill'(または 'Debit Adj。'、または 'Credit Adj。')にドロップダウンを設定しようとすると、保存が無効になっていることを示すエラーが表示されます(保存時にエラーが発生します)。私はシステムを見てきましたが、どこにビルが存在するのかわかりません - データベース内のINVだけです。ソースコードを見ると、[ARInvoiceType.List()]という型のドロップダウンリストに属性が表示されていますが、その内容は見つかりません。 APDocType列挙を見ると、どこにでも 'Bill'が表示されません。タイプを 'INV'と 'Invoice'に設定しようとしましたが、それはどちらも動作しません。 Webサービスで 'Type'をどのように設定するかを知っている必要があります。これにより、ドロップダウンの内容を表します。ここでAPBill Webサービスの問題

は、関連するコードサンプルです:

  foreach (PXResult<xvwInterCompanyProcess> rec in res) 
      { 

       xvwInterCompanyProcess icp = (xvwInterCompanyProcess)rec; 

       //Set the Doc Type... 
       apDocType = "Bill"; 
       //Save if the RefNbr has changed - unless it's the first record... 
       if (icp.OrigRefNbr != LastRefNbr) 
       { 
        if (Counter > 0) context.Submit(new Command[] { AP301000.Actions.Save }); 

        //Insert... 
        context.Submit(new Command[] { AP301000.Actions.Insert }); 

        //add the Header records... 
        context.Submit(
         new Command[] 
          { 
           //First, the header records... 
           new Value { Value = apDocType, LinkedCommand = AP301000.DocumentSummary.Type }, 
           new Value { Value = Convert.ToString(icp.DocDate), LinkedCommand = AP301000.DocumentSummary.Date }, 
           new Value { Value = icp.VendorRef, LinkedCommand = AP301000.DocumentSummary.VendorRef }, 
           new Value { Value = icp.Description, LinkedCommand = AP301000.DocumentSummary.Description }, 
           new Value { Value = "ZINTERREC", LinkedCommand = AP301000.DocumentSummary.Vendor }, 
          } 
         ); 
       } 

       //add the detail records... 
       context.Submit(
        new Command[] 
        { 
         AP301000.DocumentDetails.ServiceCommands.NewRow, 
         new Value { Value = icp.InventoryID, LinkedCommand = AP301000.DocumentDetails.InventoryID }, 
         new Value { Value = icp.TranDesc, LinkedCommand = AP301000.DocumentDetails.TransactionDescr }, 
         new Value { Value = Convert.ToString(icp.Qty), LinkedCommand = AP301000.DocumentDetails.Quantity }, 
         new Value { Value = icp.Uom, LinkedCommand = AP301000.DocumentDetails.UOM }, 
         new Value { Value = Convert.ToString(icp.Units), LinkedCommand = AP301000.DocumentDetails.UnitCost }, 
         new Value { Value = Convert.ToString(icp.TranAmt), LinkedCommand = AP301000.DocumentDetails.ExtCost }, 
         new Value { Value = icp.Account, LinkedCommand = AP301000.DocumentDetails.Account }, 
         new Value { Value = icp.APProject, LinkedCommand = AP301000.DocumentDetails.Project }, 
         new Value { Value = icp.Aptask, LinkedCommand = AP301000.DocumentDetails.ProjectTask }, 
         new Value { Value = "NONTAXABLE", LinkedCommand = AP301000.DocumentDetails.TaxCategory }, 
         new Value { Value = "2", LinkedCommand = AP301000.DocumentDetails.SourceCompany }, 
         new Value { Value = "Acumatica", LinkedCommand = AP301000.DocumentDetails.SourceApplication }, 
         new Value { Value = "AR", LinkedCommand = AP301000.DocumentDetails.SourceModule }, 
         new Value { Value = icp.OrigRefNbr + "|" + icp.LineNbr, LinkedCommand = AP301000.DocumentDetails.SourceID }, 

         //new Value { Value = "US000000000", LinkedCommand = AP301000.DocumentDetails.Subaccount }, 
        } 
        ); 

       LastRefNbr = icp.OrigRefNbr; 
       Counter++; 

      } 
      if (res.Count > 0) 
       context.Submit(new Command[] { AP301000.Actions.Save }); 
    } 

私はINSERTコマンドの前に「タイプ」を設定しようとするでしょう...

+0

詳細なコードサンプルを含めることができれば助かります – Gabriel

+1

設定する値はUIに表示される値になります。残りの値を設定する前に、Typeを最初に設定し、その後にSchema.Actions.Insertコマンドを設定します。 – Hybridzz

答えて

0

あなたが提出する前に、「タイプ」を設定する必要があります挿入コマンド。

+0

ありがとう、Hybridzz - それはそれをしました。 Insertコマンドが開始される前に 'Type'を設定しなければならないかどうか分かりませんでした – pmfith

関連する問題