Solved

Any option to Load Salesperson based on Login User.?

  • 11 November 2021
  • 1 reply
  • 238 views

Userlevel 2

When we create a sales order,  is there any option to load the Salesperson based on Login User Employee instead of loading based on customer .( User is linked with Employee and employee is linked with Salesperson) .

Any suggestions ?

 

Thanks in advance.

 

 

icon

Best answer by markusray17 16 November 2021, 19:18

View original

1 reply

Userlevel 6
Badge +5

This would require a customization although a fairly simple one.

On the SOOrder DAC

The base attribute for the default salesperson

[PXDefault(typeof(Search<CustDefSalesPeople.salesPersonID, Where<CustDefSalesPeople.bAccountID, Equal<Current<SOOrder.customerID>>, And<CustDefSalesPeople.locationID, Equal<Current<SOOrder.customerLocationID>>, And<CustDefSalesPeople.isDefault, Equal<True>>>>>), PersistingCheck = PXPersistingCheck.Nothing)]

You would just override this with something like

[PXDefault(typeof(Search<EPEmployee.salesPersonID, Where<EPEmployee.userID, Equal<Current<AccessInfo.userID>>>>), PersistingCheck = PXPersistingCheck.Nothing)]

Current<AccessInfo.userID> should give you the current userID which you can use to find the employee record of the current user and that should have the salesPersonID on there. 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved