Hello all,
I got a grid that shows all the customers ‘orders’ connected to a salesman/representant [glo_SalesmanID] and I’ve a where clause on SQL like this:
SELECT
OrderID,
StatusID,
Note_Header,
CustomerID,
SalesmanID,
EmployeeID,
OrderDate,
Id_Ord,
RequiredDate,
Expenses
FROM
orders
WHERE SalesmanID = ‘[glo_SalesmanID]’
ORDER BY
OrderDate DESC
I did then a Group By using
–SalesmanID 1st level
----CustomerID 2nd level
Now when I enter on grid as Salesman XYZ I was waiting to see ‘only’ the customers connected to XYZ only selected by the SQL.
I don’t know why but it happens that I see also other customers and theirs orders not related to XYZ ( I mean customers owed by another Salesman).
This happens if I enter using App_login . If I run application and give the SalesmanID manually it works .
Just for info on App_login I got this line that in theory clean the global variable from previous login.
sc_reset_global([usr_login], [usr_email], [glo_CustomerID], [glo_SalesmanID], [glo_UserType], [glo_SaleseosID] );
Very strange. I did all possible thoughts but I don’t know what to do to avoid this umbelievable problem.
Any suggestion is very appreciated
Thanks