Santhosh - Wednesday, February 16, 2011 7:22 AM:
Hi All,
I have created a project named "Project 1320" and its WBS is something like this.
Project 1320 //Top Level WBS
--Sub Phase 1 //Sub WBS 1
----Activity1
--Sub Phase 2 //Sub WBS 2
--Sub Phase 3 //Sub WBS 3
"WBS Element" has one its relationship as "Sub WBS" related to "WBS Element" again.
So for the above project for top level WBS(Project 1320) has three relationships.
Here is the code I'm using to retrieve the relationships
Dim myInnovator As Innovator = Me.getInnovator()
Dim tempProject As Item = Me.newItem("WBS Element","get")
tempProject.setProperty("id",Me.getProperty("wbs_id").ToString)
tempProject.setAttribute("select","id")
Dim tempWBS As Item = tempProject.apply()
Dim res
If (tempWBS.isError()) Then
res = myInnovator.newError("No Such Item exists. Detailed Error - " & tempWBS.getErrorDetail())
Return res
End If
Dim tempItem As Item = tempWBS.fetchRelationships("Sub WBS")
If (tempItem.isError()) Then
res = myInnovator.newError("No Such Sub Item exists. Detailed Error - " & tempItem.getErrorDetail())
Return res
End If
res = myInnovator.newResult("Total number of Relationships are: " & tempItem.getItemCount().ToString)
Return res
I'm getting output as only one relationship.
Could anyone please help me where I went wrong.
Santhosh
Santhosh - Wednesday, February 16, 2011 8:34 AM:
got the solution thanks