Hello,
I also used to use the PRIMARYSYSLOCPM.ANCESTORattribute in the 'SearchMore' dialog box of PM with an enhanced PRIMARYSYSLOCPM relation.
The idea is to enhance the Where clause of the PRIMARYSYSLOCPM relation by adding a complementary join criteria : the Asset of PM.
Here is a solution : systemid=(select systemid from locsystem where primarysystem='1' and siteid=:siteid) and siteid=:siteid and (location=:location or location in (select location from asset where assetnum=:assetnum and siteid=:siteid))
Once done, when a user enters i.e. "BOILER" as the Ancestor in the SearchMore dialog box , Maximo will build this query :
WHERE EXISTS (SELECT 1 FROM locancestor WHERE ancestor='BOILER' AND
systemid=(select systemid from locsystem where primarysystem='1' and siteid=pm.siteid) and siteid=pm.siteid and (location=pm.location or location in (select location from asset where assetnum=pm.assetnum and siteid=pm.siteid)))
Regards,
------------------------------
Hugues LOMBARD
Managing Applications Consultant
CAPGEMINI
------------------------------