Hi Vivek,
What kind of error you are getting ?
This is the first three line of your code.
"
try{
WTPart part = null;
wt.fc.QueryResult qr=wt.part.WTPartHelper.service.getUsesWTPartMasters(part);
"
in line no 2 you set part variable to null and without Instantiate it properly ,in line no 3 you are calling getUsesWTPartMaster() and passing part as an argumnet.
So i guess it will throw NullPointerException.
Others part of that code looks good.
thanks and regards,
Kaushik