EdwinAndrangoG
24th January 2023, 01:20
Hello,
I have the standard session tsmdm2100m000 for a customization. In it I need to display only the records (rows) that belong to a specific department. I have made a session extension but I have no idea how to do it. :confused:
I have 2 implementation options:
1) Do it by code
get.var(parent, "codEmpSer", codEmpSer)

if(len(codDepSer) >1) then
message(concat$(" ", "Departament: ",codDepSer))
endif

tsmdm200.cwoc

the variable codDepSer I was thinking of comparing it in a select with tsmdm200.cwoc to make a stor by
or
2) Create an additional field and filter by it.

Thank you in advance

RobertP
26th January 2023, 09:25
What is your input for filtration on department? I.e., (1) will the user manually specify a department depending on scenario, or (2) will filtration take place automatically based on logic, in which case the question remains - how will the department 'to be filtered on' be selected?

Next, I would ask why not use the standard table field tsmdm200.cwoc? Create a cdf field "my.cwoc". Then add a query.extension
E.g.
query.extension = " tsmdm200.cwoc = :my.cwoc "
rebuild.query()

This assuming your users would enter the value manually. Or you fill the value from somewhere else (maybe a user profile) automatically, in which case you may not even need the my.cwoc variable. Just read in the value and add it to the query extension.

I haven't created many extensions but I think above method could work (as a starting point)