Files are vaulted, Documents are created & ECN is created But the affected items list is to long to add one at a time through the ECN itself.
Can someone help me add affected items?
iomDoc.setProperty("owned_by_id", "30B991F927274FA3829655F50C99472E")
Dim relItm As IOM.Item = inn.newItem("ECN Affected Item", "add")
affItm.setProperty("affected_id", str)
relItm.setRelatedItem(affItm)
iomECN.addRelationship(relItm)
Hi.
The affected item list may be added in the one query using the parent ECN in a way like below:
Dim iomECN As Item = inn.newItem("ECN", "add")Dim i As IntegerFor i = 0 To affectedItemsList.Count - 1 Dim relItm As IOM.Item = inn.newItem("ECN Affected Item", "add") Dim affItm As IOM.Item = inn.newItem("Affected Item", "add") affItm.setProperty("affected_id", str) relItm.setRelatedItem(affItm) iomECN.addRelationship(relItm)Next iiomECN.apply()
Hope it helps,
SamsAn.
This is exactly what I am doing except I have iomECN in Edit mode.
You must have over-looked this line.
Dim str As String = iomDoc.getID ' this is nothing
I can't get the id of the iomDoc with this function or through the property itself.
I can see the id in the xml of iomDoc.
Gary
I don't know how iomDoc is generated, but i guess it is an instance of IOM Item class.
If you see id in the xml of iomDoc, then you may extract id directly from the XmlDocument like
str = iomDoc.dom.selectSingleNode("xpath_to_the_element").getAttribute("id")
Another my guess - iomDoc contains a collection of items. Then id may be extracted like
str = iomDoc.getItemByIndex(some_index_may_be_zero_for_example).getID()
iomDoc is is a single item in edit mode.
I can set the properties and apply them.
The following lines return empty strings:
'Dim str As String = iomDoc.getID()
I can see the id in the xml.
Trying it this way it says - 'getAttribute' is not a member of 'System.Xml.XmlNode'.
Dim str As String = iomDoc.dom.SelectSingleNode("xpath_to_the_element").getAttribute("id")
imports are:
Imports
Please, provide the code line used by you to see the id in the xml.
Do you get xml using the code like
Dim xml As String = iomDoc.node.OuterXml
Or
Dim xml As String = iomDoc.dom.OuterXml
ok.
Did you add iomDoc to Watch and view its OuterXml, or just highlight iomDoc variable during debugging?
(anyway finally the xml may be recieved using the additional code line pointed by me in the prev comment).
Just highlight iomDoc variable during debugging.
If I had the xpath this might work.
Dim
Try to use this code
This also returns an empty string.
Very strange... In which xml portion did you see id value? The latest my guess is <id> element. Thus this code line should help. Please, confirm.
Dim str As String = CType(iomDoc.dom.SelectSingleNode("//Item/id"), Xml.XmlElement).InnerText