rammsh - Friday, August 13, 2010 11:36 AM:
hi,
I 'm using this code to add a relationship between a Part Goal and a Part :
'Get the part AS
partAS = Inn.newItem("Part", "get")
partAS.setProperty("id", rCheckPartAS.getID)
rCheckPartAS = partAS.apply()
'Create A Cost Goal and add it to the Part AS
Dim costGoalAS As Item = Inn.newItem("Part Goal", "add")
costGoalAS.setProperty("goal", "Cost")
costGoalAS.setProperty("target_value", "0.0001")
costGoalAS.setProperty("estimated_value", "0.0001")
costGoalAS.setProperty("source_id", rCheckPartAS.getID())
costGoalAS.setProperty("actual_value", costValue)
Dim resCostGoalAS As Item = costGoalAS.apply()
If resCostGoalAS.isError() Then
Console.WriteLine("error in the creation of Part Assembly AS!")
Console.WriteLine(resCostGoalAS.getErrorDetail())
End If
rCheckPartAS.addRelationship(resCostGoalAS)
resultAS = rCheckPartAS.apply()
If resultAS.isError() Then
Console.WriteLine("error in the creation of Part Assembly AS!")
Console.WriteLine(resultAS.getErrorDetail())
End If
I ' m getting this error msg : No Items of type Part Goal found.
Am I missing something?
what is the best practice inorder to get task working?
Thanks in advance
[email protected] - Tuesday, August 17, 2010 1:43 AM:
I didn't try this way to create Item...maybe you can try another way and find if the pemission for you login has premit.