Ich bin den Web-Service konsumieren, um eine AP Rechnungen und Anpassungen erstellen, und es geht in Ordnung, bis ich versuche, den DocType ("Type") einzustellen. Wenn ich es auf "Bill" setze, habe ich kein Problem. Wenn ich versuche, das Dropdown-Menü explizit auf "Rechnung" (oder "Debit Adj." Oder "Credit Adj.") Zu setzen, erhalte ich eine Fehlermeldung, dass die Speicherung deaktiviert wurde (Fehler beim Speichern). Ich habe im System nachgeschaut und finde nirgendwo wo 'Bill' existiert - nur 'INV' in der db. Mit Blick auf den Quellcode kann ich ein Attribut in der Dropdown-Liste Typ [ARInvoiceType.List()] sehen, aber ich kann seinen Inhalt nicht finden. Wenn Sie sich die APDocType-Enumeration ansehen, wird auch nirgendwo 'Bill' angezeigt. Ich habe versucht, den Typ auf 'INV' und 'Rechnung' zu setzen - und das funktioniert auch nicht. Ich muss wissen, was ich im Web-Service für den Typ festlegen muss, damit er das darstellt, was das Dropdown-Menü anzeigt.APBill Web-Service-Problem
Hier ist das relevante Codebeispiel:
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 });
}
Ich werde versuchen, den ‚Typen‘ vor dem Einfügen-Befehl zu setzen ...
Wäre hilfreich, wenn Sie ein detailliertes Codebeispiel hinzufügen könnten – Gabriel
Der Wert, den Sie festlegen, ist der Wert, den Sie in der Benutzeroberfläche sehen. Legen Sie außerdem erst den Befehl Typ und anschließend den Befehl Schema.Actions.Insert fest, bevor Sie den Rest der Werte festlegen. – Hybridzz