I am very new to Acumatica. I am learning to create cusotmization project.
I want to Create a functionality using Event in Acumatica. If I select the AccountCD field I want the Accoutn Name to auto fill. How can I do it and what are different ways to do.
If I get a sample code for is much appreciated!!!
Solved
AutoFill the Account Name based on Account Code
Best answer by Saikrishna V
Hello
The FieldUpdated event is commonly used in scenarios where selecting or changing one field should automatically update another.You can try below sample code.
protected void _(Events.FieldUpdated<Customer, Customer.acctCD> e)
{
var row = e.Row;
if (row == null) return;
Customer cust = PXSelect<Customer,
Where<Customer.bAccountID, Equal<Required<Customer.bAccountID>>>>
.Select(e.Cache.Graph, row.BAccountID);
if (cust != null)
row.AcctName = cust.AcctName;
}
The following link provides information on event handlers
https://help.acumatica.com/(W(4))/Help?ScreenId=ShowWiki&pageid=abe22b44-8111-4069-8a24-fa5c901ec5dd
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.