Hi,
I’m using Acumatica API in a C# project. I wrote following code to access all the Purchase Receipts:
if (InitAPI() == false) { return ""; }
PO302000Content POReceipt = context.PO302000GetSchema();
#region Fields
List<Command> cmdSelect = new List<Command>();
cmdSelect.Add(POReceipt.DocumentSummary.ReceiptNbr);
cmdSelect.Add(POReceipt.DocumentSummary.VendorRef);
cmdSelect.Add(POReceipt.DocumentSummary.Status);
cmdSelect.Add(POReceipt.DocumentSummary.ExternalNbr);
cmdSelect.Add(POReceipt.Other.Branch);
cmdSelect.Add(POReceipt.Other.BillDate);
cmdSelect.Add(POReceipt.Other.INRefNbr);
cmdSelect.Add(POReceipt.Details.InventoryID);
Field lmd = new Field
{
ObjectName = POReceipt.DocumentSummary.ReceiptNbr.ObjectName,
FieldName = "LastModifiedDateTime"
};
cmdSelect.Add(lmd);
Field cdt = new Field
{
ObjectName = POReceipt.DocumentSummary.ReceiptNbr.ObjectName,
FieldName = "CreatedDateTime"
};
cmdSelect.Add(cdt);
#endregion Fields
#region Filters
List<Filter> filters = new List<Filter>();
filters.Add(new Filter()
{
Field = new Field
{
ObjectName = POReceipt.DocumentSummary.ReceiptNbr.ObjectName,
FieldName = "CreatedDateTime"
},
Condition = FilterCondition.GreaterOrEqual,
Value = DateTime.Now.AddDays(-1).ToLongDateString(),
Operator = FilterOperator.And
});
#endregion Filters
var POReceiptExport = context.PO302000Export(cmdSelect.ToArray(), filters.ToArray(), 0, false, false);
foreach (var dd in POReceiptExport)
{
}
I’m getting all the field values correctly except INRefNbr. Which is showing me a blank value. I checked all the PO Receipts are in released status and have a value in this field at screen. Any idea why I’m not getting this field value and how to resolve that? would really appreciate your help..
Best answer by adilaleem
View original