Solved

Createing AR Payment throwing error 'Reference Nbr.' cannot be found in the system

  • 26 April 2024
  • 1 reply
  • 25 views

Userlevel 2
Badge

 

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.

 

icon

Best answer by Dmitrii Naumov 29 April 2024, 16:15

View original

1 reply

Userlevel 7
Badge +5

@adilaleem is there a reason you use outdated screen based API?

I’d recommend you to switch to the Contract Based REST API, see documentation here:

https://help.acumatica.com/(W(8))/Help?ScreenId=ShowWiki&pageid=b25e527e-8187-485e-9c8e-93aa5c2e8931

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved