Question

BAccount - Class ID not found error

  • 22 March 2023
  • 0 replies
  • 146 views

Userlevel 3
Badge

Hi All,

We are having this issue when updating the ClassID during event Location_CBranchID_fieldUpdated.

Basically we are trying to update the ClassID value in the cache for BAccount.

Code Snippet

 protected virtual void Location_CBranchID_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e, PXFieldUpdated InvokeBaseHandler)
        {
            if (e.Row == null) return;      
         var classId = Base.BAccount.Current.ClassID; 
          

           //Exception is thrown here.. 
            Base.BAccount.Cache.SetValueExt<BAccount.classID>(Base.BAccount.Current, classId);
           

Base.BAccount.Cache.SetDefaultExt<MAKLBAccountExt.usrMAKLCuryID>(Base.BAccount.Current);
        }

        DAC
        [PXSelector(typeof(CRCustomerClass.cRCustomerClassID), DescriptionField = typeof(CRCustomerClass.description), CacheGlobal = true)]
        [PXUIField(DisplayName = "Class")]
        public virtual string ClassID { get; set; }

Stack Trace :

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.SetValueExt(Object data, String fieldName, Object value)
   at PX.Objects.CR.MAKLBusinessAccountMaintExt.Location_CBranchID_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e, PXFieldUpdated InvokeBaseHandler) in C:\git\Advanced-Project-EVO-KC\MAKLEVOKC2019R1\EVO_CR\Graph\MAKLBusinessAccountMaintExt.cs:line 194
   at PX.Data.PXCache.OnFieldUpdated(String name, Object row, Object oldValue, Boolean externalCall)
   at PX.Data.PXCache`1.SetDefaultExt(Object data, String fieldName, Object value)
   at PX.Objects.CR.MAKLBusinessAccountMaintExt.Location_RowInserted(PXCache sender, PXRowInsertedEventArgs e, PXRowInserted InvokeBaseHandler) in C:\git\Advanced-Project-EVO-KC\MAKLEVOKC2019R1\EVO_CR\Graph\MAKLBusinessAccountMaintExt.cs:line 304
   at PX.Data.PXCache.OnRowInserted(Object item, Object pending, Boolean externalCall)
   at PX.Data.PXCache`1.Insert(Object data, Boolean bypassinterceptor)
   at PX.Objects.CR.Extensions.DefLocationExt`6.InsertLocation(PXCache cache, TMaster row)
   at PX.Objects.CR.Extensions.DefLocationExt`6._(RowInserted`1 e, PXRowInserted del)
   at PX.Data.PXCache.OnRowInserted(Object item, Object pending, Boolean externalCall)
   at PX.Data.PXCache`1.Insert(IDictionary values)
   at PX.Data.PXGraph.ExecuteInsert(String viewName, IDictionary values, Object[] parameters)

 

Any thoughts or suggestions to overcome this issue?

 


0 replies

Be the first to reply!

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