Skip to main content
Solved

AutoFill the Account Name based on Account Code

  • April 2, 2025
  • 1 reply
  • 13 views

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!!!

Best answer by Saikrishna V

Hello ​@anupusefulbi 

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

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

1 reply

Forum|alt.badge.img
  • Varsity I
  • 36 replies
  • Answer
  • April 2, 2025

Hello ​@anupusefulbi 

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


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