I started a topic concerning ValidLink but this actually came out of a different issue I was seeing so I thought I would ask about that and see if anyone had some insight into what was going on.
I am capturing the item inserted event of the view document and then checking business rules to see if the “link” is allowed. (This is from the document changed event and then checking for the inserted flag in the event) These business rules are dependent on what “type” of link they are trying to create hence the reason I would like to have that information in the ValidLink event of the view. Anyways what I noticed is if I decide the link is not allowed during the inserted event, I call removeObject of the document passing in the newly created link. This works OK view wise but if I go to the port of one of the nodes then the count is incorrect and the port still thinks the link is still present. As a matter of fact running through the collection of links attached to the port still shows the removed link.
My questions are, Is RemoveObject the right method to call and is there a better event to capture? Thanks.