【Aras Innovator 二次开发入门】5 创建对象Document
【Aras Innovator 二次开发入门】5 创建对象Document使用代码创建对象:
可以结合SQL去查询下对应对象的表和字段,set property实际上就是去设置这些值。ok后,apply即可!
Console.WriteLine("4 =============Add a item======================");
//we select the information from sql
//select item_number,name,classification,authoring_tool,effective_date from innovator.DOCUMENT
//ITEM_NUMBER NAME CLASSIFICATION AUTHORING_TOOL EFFECTIVE_DATE
// testDoc NULL Process Text Editor 2018 - 07 - 05 02:25:27.000
Item newDocItem = newInnovator.newItem("Document", "add");
newDocItem.setProperty("item_number", "plmhomeTestDoc2222");
newDocItem.setProperty("name", "plmhomeDocument");
newDocItem.setProperty("classification", "Process");
newDocItem.setProperty("authoring_tool", "Text_Editor");
newDocItem.setProperty("effective_date", "2018-07-06");
newDocItem.apply();
if (newDocItem.isError())
{
Console.WriteLine("Create error !");
}
else
{
Console.WriteLine("works fine to create the docuement");
}
页:
[1]