Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi,
Could anyone let me know the type of association between a WTPart assembly and its component wtpart?
I am looking to create a report using Report manager where i have a set of WTPart numbers and whose parent WTPart I am trying to identify.
Thanks,
Prabhu Vakel
Solved! Go to Solution.
"I am looking to create a report using Report manager where i have a set of WTPart numbers and whose parent WTPart I am trying to identify."
You want to join WTPart to WTPartMaster using the WTPartUsageLink where the WTPart Number is a string parameter that a user can enter, and the result includes the Part Number and Part Name of the WTPartMaster, as well as any other information you might want, like Chile Part Name and Number, Context Name and/or Folder Path of either the WTPart child or the WTPartMaster parent.
Remember that a usagelink is a version to master relationship, so you will not get a link to any particular parent version this way. If you want a navigable link to all versions of the parent, then you have to additoinally join a WTPart2 to the WTPartMaster using the Master Reference (I think that is the name, you just have to look at the link objects and pick the one that looks like a master reference). At that point you will get all iterations of the parent version unless you filter by Latest Iteration = 1 for that parent part. But even then you get all versions. If you want the latest version of the parent, then you have to do a subselect of the parent part to get the one version of the parent with the MAX value for VersionSortID. There have been examples of that kind of subselect for documents and parts on forums, and if you end up needing that then I can post something here. Of course, if you just need the parent number then all of these extra set up is unnecessary.
Al Anderson
wt.part.WTPartUsageLink
"I am looking to create a report using Report manager where i have a set of WTPart numbers and whose parent WTPart I am trying to identify."
You want to join WTPart to WTPartMaster using the WTPartUsageLink where the WTPart Number is a string parameter that a user can enter, and the result includes the Part Number and Part Name of the WTPartMaster, as well as any other information you might want, like Chile Part Name and Number, Context Name and/or Folder Path of either the WTPart child or the WTPartMaster parent.
Remember that a usagelink is a version to master relationship, so you will not get a link to any particular parent version this way. If you want a navigable link to all versions of the parent, then you have to additoinally join a WTPart2 to the WTPartMaster using the Master Reference (I think that is the name, you just have to look at the link objects and pick the one that looks like a master reference). At that point you will get all iterations of the parent version unless you filter by Latest Iteration = 1 for that parent part. But even then you get all versions. If you want the latest version of the parent, then you have to do a subselect of the parent part to get the one version of the parent with the MAX value for VersionSortID. There have been examples of that kind of subselect for documents and parts on forums, and if you end up needing that then I can post something here. Of course, if you just need the parent number then all of these extra set up is unnecessary.
Al Anderson
Hi Albert,
Thanks for your help.
It would really be informative if you can share with us the link to any of the forums discussing such topics.
Appreciate your help.
Regards,
Prabhu Vakel
Prabhu,
Did the above responses get you what you needed? If so, can you please mark the thread as answered?
Thanks,
Lori