Skip to main content
Answer

Sync Customer, Location and Custom Field in Invoices Screen

  • March 15, 2022
  • 2 replies
  • 84 views

Forum|alt.badge.img+2

We have a requirement where we need to make sure if a certain user is logged into the system, in the Invoices screen, we need the Customer, Location to be filled automatically and a custom field called Sales Channel (dropdown field) must be filled as LOCAL or FOREIGN according to the logged in user. How can we approach this development. I have attached a screenshot for reference.

Thank you.

 

Best answer by Dioris Aguilar

@TharidhiP You should customize the User Profile (SM203010) screen to add those custom values per user (Customer and Location) and override the FieldDefaulting event for ARInvoice_CustomerID and ARInvoice_CustomerLocationID for the Invoices screen (SO303000).
You should check the current logged user using AccessInfo class in order to bring the corresponding custom selection set in the User Profile screen.

Same logic applies for the Sales Channel field → custom field in User Profile screen to store the value per user and implement the FieldDefaulting event in Invoices screen using the AccessInfo class to get the current logged user.

You’ll probably need to call e.Cache.SetDefaultSet<CustomerID>(...) (same for Location and Sales Channel) in FieldUpdated_DocType.

2 replies

darylbowman
Captain II
Forum|alt.badge.img+15

What have you tried so far?


Dioris Aguilar
Jr Varsity I
Forum|alt.badge.img+2
  • Jr Varsity I
  • Answer
  • March 15, 2022

@TharidhiP You should customize the User Profile (SM203010) screen to add those custom values per user (Customer and Location) and override the FieldDefaulting event for ARInvoice_CustomerID and ARInvoice_CustomerLocationID for the Invoices screen (SO303000).
You should check the current logged user using AccessInfo class in order to bring the corresponding custom selection set in the User Profile screen.

Same logic applies for the Sales Channel field → custom field in User Profile screen to store the value per user and implement the FieldDefaulting event in Invoices screen using the AccessInfo class to get the current logged user.

You’ll probably need to call e.Cache.SetDefaultSet<CustomerID>(...) (same for Location and Sales Channel) in FieldUpdated_DocType.