Setting Salesperson Code to User ID for new SOs

Hi there. I want to set the Salesperson code to User ID for new SOs so that the sales people don’t need to and cannot forget. :slight_smile: Please could someone advise me on the best way to do this? Many thanks in advance

IF SalesPurchPerson.GET(USERID) THEN VALIDATE(“Salesperson Code”, USERID)

Maybe it´s better to add a new field in the table 91 User Setup with a Table Relation to the table 13 Salesperson/Purchaser. OnInsert Trigger you can programm somethin like this: UserSetup.GET(userid); if usersetup.“salesperson code” <> ‘’ then validate(“Salesperson Code”,usersetup.“salesperson Code” So it´s not necessary that the Salesperson code ist always the userid.

I don’t think that is a better solution at all. It’s one way of keeping the salesperson code connected to a User setup record, but the solution in the first reply would work just as well for the goal of automatically populating the salesperson…

Many thanks for you help… It works perfectly now! [:D]

quote:

I don’t think that is a better solution at all. It’s one way of keeping the salesperson code connected to a User setup record, but the solution in the first reply would work just as well for the goal of automatically populating the salesperson…
Originally posted by DenSter - 2005 Jul 14 : 20:01:27

…if UserId is equal to SalespersonCode, yes…[^]

quote:

Hi there. I want to set the Salesperson code to User ID for new SOs so that the sales people don’t need to and cannot forget. :slight_smile: Please could someone advise me on the best way to do this? Many thanks in advance
Originally posted by RobbieX - 2005 Jul 14 : 02:59:03

Are you working with Windows Authentication? If yes, you might have problems because of too short Salesperson/Purchaser Code (Code 10). Cheers, Jurica

quote:

quote:
I don’t think that is a better solution at all. It’s one way of keeping the salesperson code connected to a User setup record, but the solution in the first reply would work just as well for the goal of automatically populating the salesperson…
Originally posted by DenSter - 2005 Jul 14 : 20:01:27

…if UserId is equal to SalespersonCode, yes…[^]
Originally posted by Anfinnur - 2005 Jul 15 : 06:23:19

Which I believe was the original question… how to set the saleperson code to the userid… [^]