Skip to main content
Solved

Any option to Load Salesperson based on Login User.?

  • 11 November 2021
  • 1 reply
  • 261 views

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.

 

 

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