AR302000Content ARPayment = context.AR302000GetSchema();
#region PaymentCommand
var cmdInsert = new Command[]
{
new Value
{
Value = "Payment",
LinkedCommand = ARPayment.PaymentSummary.Type
},
new Value
{
Value = "CATLX11572",
LinkedCommand = ARPayment.PaymentSummary.Customer
},
new Value
{
Value = "MAIN",
LinkedCommand = ARPayment.PaymentSummary.Location
},
new Value
{
Value = "USD",
LinkedCommand = ARPayment.PaymentSummary.Currency
},
new Value
{
Value = "Balanced",
LinkedCommand = ARPayment.PaymentSummary.Status
},
new Value
{
Value = "CSC-IL",
LinkedCommand = ARPayment.FinancialLinkToGL.Branch
},
new Value
{
Value = "10200",
LinkedCommand = ARPayment.FinancialLinkToGL.ARAccount
},
new Value
{
Value = "000000000000000000",
LinkedCommand = ARPayment.FinancialLinkToGL.ARSubaccount
},
new Value
{
Value = "CHECK",
LinkedCommand = ARPayment.PaymentSummary.PaymentMethod
},
new Value
{
Value = "CATLX11572TEST",
LinkedCommand = ARPayment.PaymentSummary.PaymentRef
},
new Value
{
Value = "25090.44",
LinkedCommand = ARPayment.PaymentSummary.PaymentAmount
},
new Value
{
Value = "TEST Payment - DONOT RELEASE",
LinkedCommand = ARPayment.PaymentSummary.Description
},
new Value
{
Value = "04-26-2024",
LinkedCommand = ARPayment.PaymentSummary.ApplicationDate
},
new Value
{
Value = "04-2024",
LinkedCommand = ARPayment.PaymentSummary.ApplicationPeriod
},
new Value
{
Value = "CSC IL CKG",
LinkedCommand = ARPayment.PaymentSummary.CashAccount
},
//ARPayment.DocumentsToApply.ServiceCommands.NewRow,
new Value
{
Value = "CSC-IL",
LinkedCommand = ARPayment.DocumentsToApply.Branch
},
new Value
{
Value = "Invoice",
LinkedCommand = ARPayment.DocumentsToApply.DocType
},
new Value
{
Value = "CATLX11572",
LinkedCommand = ARPayment.DocumentsToApply.Customer
},
new Value
{
Value = "AR0139382",
LinkedCommand = ARPayment.DocumentsToApply.ReferenceNbr
},
new Value
{
Value = "25090.44",
LinkedCommand = ARPayment.DocumentsToApply.AmountPaid
},
ARPayment.Actions.Save
};
context.AR302000Submit(cmdInsert);
#endregion PaymentCommand
On submitting above command I’m getting this error:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> PX.Data.PXFieldProcessingException: Error: An error occurred during processing of the field Reference Nbr.: Error: 'Reference Nbr.' cannot be found in the system. ---> PX.Data.PXSetPropertyException: Error: '[AdjdRefNbr]' cannot be found in the system.
at PX.Data.PXSelectorAttribute.throwNoItem(String[] restricted, Boolean external, Object value)
at PX.Data.PXSelectorAttribute.Verify(PXCache sender, PXFieldVerifyingEventArgs e, Object& item)
at PX.Data.PXSelectorAttribute.FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
at PX.Data.PXCache.OnFieldVerifying(String name, Object row, Object& newValue, Boolean externalCall)
at PX.Data.PXCache`1.FillWithValues(TNode item, TNode copy, IDictionary values, PXCacheOperation operation, Boolean externalCall)
--- End of inner exception stack trace ---
at PX.Data.PXCache`1.FillWithValues(TNode item, TNode copy, IDictionary values, PXCacheOperation operation, Boolean externalCall)
at PX.Data.PXCache`1.Locate(IDictionary keys)
at PX.Api.SyImportProcessor.SyStep.CommitChangesInt(Object itemToBypass, PXFilterRow[] targetConditions, PXFilterRow[] filtersForAction, SyImportRowResult importResult)
at PX.Api.SyImportProcessor.SyStep.CommitChanges(Object& itemToBypass, PXFilterRow[] targetConditions, PXFilterRow[] filtersForAction)
at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable(CancellationToken token)
at PX.Api.ScreenUtils.Submit(String screenId, IReadOnlyList`1 commands, SchemaMode schemaMode, PXGraph& graph, String& redirectContainerView, String& redirectScreen, Boolean mobile, Dictionary`2 viewFilters, IGraphHelper graphHelper)
at PX.Api.Services.ScreenService.Submit(String id, IEnumerable`1 commands, SchemaMode schemaMode, Boolean mobile, PXGraph& forceGraph, String& redirectContainerView, String& redirectScreen, Dictionary`2 viewFilters, IGraphHelper graphHelper)
at PX.Api.Services.ScreenService.Submit(String id, IEnumerable`1 commands, SchemaMode schemaMode)
at PX.Api.Soap.Screen.ScreenGate.Submit(Command[] commands)
--- End of inner exception stack trace ---
Note: I’m able to create this payment manually. this is valid Refrence Nbr and in Open status.
Best answer by Dmitrii Naumov
View original