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;
publicclass SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
protected Lazy<CustomerMaint> lazyCustomerMaint =
new Lazy<CustomerMaint>(() => PXGraph.CreateInstance<CustomerMaint>());
public PXFilter<CustomerMaint.CustomerBalanceSummary> CustomerBalance;
protectedvirtual 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();
yieldreturn g.CustomerBalance.Current;
}
}
}
}
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.