2015-01-22 2 views
0

웹 서비스 API에서 특정 속성을 검색 할 수 있는지 궁금합니다. 내보내기 할 때 IN202500.AttributesAttributes.Value을 시도했지만 인벤토리의 모든 속성을 나열했습니다. 나는 또한 속성이 테이블에 [AttributeName] _Attributes 인벤토리 테이블에 저장되어 있음을 발견했습니다. 검색하는 방법이 있습니까? Acumatica API의 StockItems에서 특성 필드를 검색하는 방법?

내가

IN202500Content IN202500 = context.IN202500GetSchema(); 
 
context.IN202500Clear(); 
 

 
Command[] oCmd = new Command[] { 
 
         IN202500.StockItemSummary.ServiceCommands.EveryInventoryID, 
 
         IN202500.StockItemSummary.InventoryID, 
 
         IN202500.StockItemSummary.Description, 
 
         IN202500.StockItemSummary.ItemStatus, 
 
         IN202500.GeneralSettingsItemDefaults.ItemClass, 
 
         IN202500.GeneralSettingsItemDefaults.LotSerialClass, 
 
         new Field { 
 
          ObjectName = IN202500.StockItemSummary.InventoryID.ObjectName, 
 
          FieldName = "BARCODE_Attributes"}, 
 
         new Field { 
 
          ObjectName = IN202500.StockItemSummary.InventoryID.ObjectName, 
 
          FieldName = "DfltReceiptLocationID"}, 
 
         new Field { 
 
          ObjectName = IN202500.StockItemSummary.InventoryID.ObjectName, 
 
          FieldName = "LastModifiedDateTime"} 
 
         }; 
 

 
Filter[] oFilter = new Filter[] { 
 
         new Filter 
 
         { 
 
          Field = new Field { 
 
           ObjectName = IN202500.StockItemSummary.InventoryID.ObjectName, 
 
           FieldName = "LastModifiedDateTime"}, 
 
          Condition = FilterCondition.Greater, 
 
          Value = SyncDate 
 
         } 
 
        }; 
 

 
String[][] sReturn = context.IN202500Export(oCmd, oFilter, 0, true, false);

그러나 반환 속성 필드는 빈 문자열 (는 속성을 검색 할 기대) 사용하고있는 코드입니다. 감사합니다, G

답변

1

을 값. 이 필드는 WSDL 스키마에 나타나지 않으므로 Field 개체를 만들어 내보내기 기능에 전달해야합니다.

네이티브 개체/네이티브 필드 이름 열을 표시하여 내보내기 시나리오에서 필드 이름과 개체 이름을 조회했습니다. 수출 호출을 발생으로 다음과 같습니다 : 특정 목록 항목 (Z730P00073)에 대한

 var result = screen.Export(new IN202500.Command[] { 
      new IN202500.Value() { LinkedCommand = schema.StockItemSummary.InventoryID, Value = "Z730P00073"}, 
      schema.StockItemSummary.InventoryID, 
      schema.StockItemSummary.Description, 
      new IN202500.Field { FieldName = "COLOR_Attributes", ObjectName = "Item"}, 
      new IN202500.Field { FieldName = "HWMAN_Attributes", ObjectName = "Item"}, 
     }, null, 0, true, true); 

이 코드는 두 가지 속성 값 (COLOR 및 HWMAN 속성) 검색합니다. 결과 변수에는 2 차원 배열이 포함되어 있으므로 배열에서 결과를 얻는 데 도움이 필요하면 알려주십시오.

+0

나는 매우 비슷한 것을 가지고 있지만 Attribute 필드는 문자열 배열에서 비어 있습니다. 또한, 나는 새로운 IN202500.Field (또는 IN202500.Value)를 할 수 없으며, 그냥 새로운 필드 또는 새로운 값으로 이동하지만 중요한 것은 아닐 것입니다. (데이터를 검색 할 수 있기 때문에 - 속성 제외) – GaGa

+0

초기 게시물에서 실행 한 코드를 게시했는데 내가 잘못한 것을 말해 줄 수 있습니까? – GaGa

+0

@Gavin 코드로 테스트 한 결과, 내 측면에서 잘 작동합니다 (BARCODE를 COLOR 속성으로 대체하여 DB와 일치). – Gabriel

0

이 예는 항목을 추가하고 속성과 이미지를 설정하는 방법을 보여줍니다 : 당신은 특정 속성을 검색하는 화면의 기본보기에 추가 된 동적 필드를 활용할 수

 byte[] filedata; 
     using (System.IO.FileStream file = System.IO.File.Open(@"C:\1.jpg", System.IO.FileMode.Open)) 
     { 
      filedata = new byte[file.Length]; 
      file.Read(filedata, 0, filedata.Length); 
     } 

     Random rnd = new Random(); 
     string inventoryID = "CPU0000" + rnd.Next(100).ToString(); 
     context.IN202500Clear();    
     IN202500result = context.IN202500Submit(
      new Command[] 
      { 
       IN202500.Actions.Insert, 
       new Value { Value = inventoryID, LinkedCommand = IN202500.StockItemSummary.InventoryID }, 
       new Value { Value = inventoryID, LinkedCommand = IN202500.StockItemSummary.Description }, 
       new Value { Value = "CPU", LinkedCommand = IN202500.GeneralSettingsItemDefaults.ItemClass, Commit = true }, 
       new Value { Value = "TAXABLE", LinkedCommand = IN202500.GeneralSettingsItemDefaults.TaxCategory, Commit = true },      
       //attributes - pairs 
       new Value { Value = "FREQUENCY", LinkedCommand = IN202500.AttributesAttributes.Attribute }, 
       new Value { Value = "1400", LinkedCommand = IN202500.AttributesAttributes.Value, Commit = true }, 
       new Value { Value = "CORE", LinkedCommand = IN202500.AttributesAttributes.Attribute }, 
       new Value { Value = "2 CORES", LinkedCommand = IN202500.AttributesAttributes.Value, Commit = true }, 
       new Value { Value = "INTGRAPH", LinkedCommand = IN202500.AttributesAttributes.Attribute }, 
       new Value { Value = "True", LinkedCommand = IN202500.AttributesAttributes.Value, Commit = true }, 
       //image 
       new Value { Value = Convert.ToBase64String(filedata), FieldName = "1.jpg", LinkedCommand = IN202500.StockItemSummary.ServiceCommands.Attachment }, //uploads 
       new Value { Value = "1.jpg", LinkedCommand = IN202500.Attributes.ImageUrl }, //sets as an item picture 
       IN202500.Actions.Save, 
       //return the result 
       IN202500.StockItemSummary.InventoryID 
     }); 
+0

이 샘플에서는 특정 특성을 검색하고 내보내는 방법이 아니라 항목을 추가하고 특성을 설정하는 방법을 보여줍니다. 그러나 그것은 자신의 예를 만들기 위해 영업 이익을 충분히 제공해야합니다 :) – Gabriel

+0

내보내기 기능을 사용하여 속성을 검색하는 방법에 대해 자세히 설명해 주시겠습니까? @Gabriel – GaGa

+0

@ 개빈 방금 한 일을 보여주는 새로운 대답을 올렸습니다. – Gabriel

관련 문제