Hi,
How can I create and attach file with a CAD Document through IOM API?
Here is the code I am trying to implement.
<hr />
// Create the CAd Document item
var docItem = MyInnovator.newItem("CAD", "add");
docItem.setProperty("item_number", "CADDoc 004");
// Create the File item and set the path to the file.
var fileItem = MyInnovator.newItem("File", "add");
fileItem.setProperty("filename", "My Document.docx");
fileItem.attachPhysicalFile("D:\\My Document.docx");
// Create the relationship between the CAd Document and File
var relItem = MyInnovator.newItem("CADFiles", "add");
docItem.addRelationship(relItem);
relItem.setRelatedItem(fileItem);
var results = docItem.apply();
<hr />
I guess CAD files are null able type of relation since there is null value in related id column in CADFiles table...