I have did an customization in customer card with 2 fields, Primary person code and secondary person code which code is coming from user setup table salesperson/purchaser field in that i want for the userId which salesperson code is assign only those customer should be visible in customer list whenever customer list opens.
i am working with this code but it is only those customer are visible which are assign to salesperson code not the primary and secoandry so what should i do for that?
- by extending customerlist
trigger OnAfterGetRecord()
begin
Vuser.SetFilter("User ID", UserId);
if Vuser.FindFirst() then begin
if Vuser."Salespers./Purch. Code" <> '' then
Rec.SetFilter("Salesperson Code", Vuser."Salespers./Purch. Code");
end;
VSalesperson: Code[20];
Vuser: Record "User Setup";