Skip to main content
Solved

Can I put customer balance on SO screen(SO301000) without writing code

  • October 11, 2020
  • 2 replies
  • 288 views

Forum|alt.badge.img+5

Hello,

      I know a little about customization projects but I am still afraid of writing code. I have a requirement that to display customer credit limit and customer balance on SO screen (SO301000) .

         For customer credit limit, the SO screen already have “cusotmer” Data view, and that view has customer credit limit, so I can simply use it.

         However customer balance exists in “customerbalance”  view, and this view does NOT associate with SO screen right now. SO I can not use it directly.

       I know probably with code writing that as BQL or something, I can get the customer balance.

But I am wondering is there a better/easier way I can achieve this requirement.

      Thank you in advance. If I have to use code, can somebody give me a sample for reference?

Best answer by Nayan Mansinha

Yes it will require writing code.  The approach will require one to create similar customerbalance view in Sales Order screen.  e.g. code would be:

namespace PX.Objects.SO
{
    using PX.Objects.AR;
    using System.Collections;

    public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
    {
		protected Lazy<CustomerMaint> lazyCustomerMaint =
			new Lazy<CustomerMaint>(() => PXGraph.CreateInstance<CustomerMaint>());

		public PXFilter<CustomerMaint.CustomerBalanceSummary> CustomerBalance;
		protected virtual IEnumerable customerBalance()
		{
			Customer customer = Base.customer.Current;
			if (customer != null && customer.BAccountID > 0L)
			{
				var g = lazyCustomerMaint.Value;
				g.BAccount.Current = g.BAccount.Search<BAccount.bAccountID>(customer.BAccountID);
				g.CustomerBalance.Current = g.CustomerBalance.Select();
				yield return g.CustomerBalance.Current;

			}
		}

	}
}

 

View original
Did this topic help you find an answer to your question?

Nayan Mansinha
Community Manager
Forum|alt.badge.img+2
  • Acumatica Developer Support
  • October 13, 2020

Yes it will require writing code.  The approach will require one to create similar customerbalance view in Sales Order screen.  e.g. code would be:

namespace PX.Objects.SO
{
    using PX.Objects.AR;
    using System.Collections;

    public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
    {
		protected Lazy<CustomerMaint> lazyCustomerMaint =
			new Lazy<CustomerMaint>(() => PXGraph.CreateInstance<CustomerMaint>());

		public PXFilter<CustomerMaint.CustomerBalanceSummary> CustomerBalance;
		protected virtual IEnumerable customerBalance()
		{
			Customer customer = Base.customer.Current;
			if (customer != null && customer.BAccountID > 0L)
			{
				var g = lazyCustomerMaint.Value;
				g.BAccount.Current = g.BAccount.Search<BAccount.bAccountID>(customer.BAccountID);
				g.CustomerBalance.Current = g.CustomerBalance.Select();
				yield return g.CustomerBalance.Current;

			}
		}

	}
}

 


purwandaruw
Freshman II
Forum|alt.badge.img

 Interesting Nayan,

Will inform this also to my team to pull out data for vendor tab. 

nmansinha wrote:

Yes it will require writing code.  The approach will require one to create similar customerbalance view in Sales Order screen.  e.g. code would be:

namespace PX.Objects.SO
{
    using PX.Objects.AR;
    using System.Collections;

    public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
    {
		protected Lazy<CustomerMaint> lazyCustomerMaint =
			new Lazy<CustomerMaint>(() => PXGraph.CreateInstance<CustomerMaint>());

		public PXFilter<CustomerMaint.CustomerBalanceSummary> CustomerBalance;
		protected virtual IEnumerable customerBalance()
		{
			Customer customer = Base.customer.Current;
			if (customer != null && customer.BAccountID > 0L)
			{
				var g = lazyCustomerMaint.Value;
				g.BAccount.Current = g.BAccount.Search<BAccount.bAccountID>(customer.BAccountID);
				g.CustomerBalance.Current = g.CustomerBalance.Select();
				yield return g.CustomerBalance.Current;

			}
		}

	}
}

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings