All person's departments in service item request property

Hi, 

In v92, is there a way to populate a request parameter with all departments a person belongs to? Not only directly (Person:UID_Department) but also assigned (PersonInDepartment). I've been using calculated parameters , filled both Value  Definition and Value Calculation with Department and PersonInDepartment but that doesn't seem to do the trick. I'm not familiar with the script syntax in valuation/validation scripts in tems of filling a parameter value with results from a query. 

Any ideas?
Thanks!

  • Solved, it was a tricky where clause. Using the wizard:

    ( EXISTS ( SELECT 1 FROM  (SELECT UID_Department FROM PersonInDepartment WHERE  EXISTS ( SELECT 1 FROM  (SELECT UID_Person FROM Person WHERE UID_Person = '%UID_PersonOrdered%') as X  WHERE X.UID_Person = PersonInDepartment.UID_Person  ) ) as X  WHERE X.UID_Department = Department.UID_Department  ) ) OR ( EXISTS ( SELECT 1 FROM  (SELECT UID_Department FROM Person WHERE UID_Person='%UID_PersonOrdered%') as X  WHERE X.UID_Department = Department.UID_Department  ) )

    That said, you must be very careful when editing the Value Calculation scripts (Valuation/Validation) . We did some tests setting the value of one parameter via script and ended up deleting the whole request property definition because the Manager app would hang and close everytime we tried to edit the definition.