Rajiv - Thursday, January 6, 2011 8:57 AM:
JensRollenmueller - Monday, January 10, 2011 2:54 PM:
Hello,
for retrieving the BOM you must get the relationship "Part BOM". Here is a small prototype example, but you could also try to view some of the community solutions "e.g. Multilevel BOM" to get an betteer overview.
Item partBOM_ItemColl = m_Innovator.newItem();
//get the Part BOM
Item partBOM_ItemColl= m_Innovator.newItem("Part BOM", "get");
partBOM_ItemColl.setAttribute("select", "related_id(id)");
partBOM_ItemColl.setAttribute("where", "source_id='" + parentPartItem.getID() + "'");
Item partBOM_RelationResu = partBOM_ItemColl.apply();
for (int iNbRecords=0; iNbRecords<(partBOM_RelationResu.getItemCount()); iNbRecords++)
{
Item partBOM_Item = partBOM_RelationResu.getItemByIndex(iNbRecords);
Item childPartItem = partBOM_Item.getRelatedItem();
}
=========================================
I hope it works - haven't tried it within aras - just wrote it into the community.
Also you are able to get more informations about Part => Document relations ...
Regards, Jens Rollenmüller
(T-Systems; Partner of Aras since 2010)
davidchao - Friday, May 18, 2012 1:33 AM:
Dear sir ,
My name is david chao, I am from Taiwan. I am trying the aras innovator 9.3 and I try to use IOM to insert data into Part item, but it does not work, I do not know what is wrong? Any one who can help me, I will be very appreciate, thanks. my e-mail is:[email protected].
The following is my program:
<html>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
var innServerURL = "192.168.1.7/.../InnovatorServer.aspx";
var dbID = 'InnovatorSolutions';
var login = 'admin';
var password = 'innovator';
var iomFactory = new ActiveXObject("Aras.IOM.IomFactory.9.3");
var httpServerConnection = iomFactory.CreateHttpServerConnection(innServerURL, dbID, login, password);
var loginResult = httpServerConnection.login();
if (loginResult.IsError())
{
document.write(loginResult.GetErrorDetail());
}
else
{
var innovator = new Innovator();
var partItem = innovator.newItem();
partItem.loadAML(
"<Item type='Part' action='add' >" +
"<item_number>123-456</item_number>" +
"<description>Blah blah</description>" +
"<Relationships>" +
"<Item type='Part BOM' action='add'>" +
"<quantity>10</quantity>" +
"<related_id>" +
"<Item type='Part' action='get'>" +
"<item_number>555-555</item_number>" +
"</Item>" +
"</related_id>" +
"</Item>" +
"</Relationships>" +
"</Item>"
);
var resultItem = partItem.apply();
if (resultItem.isError()) {
top.aras.AlertError (resultItem.getErrorDetail());
return;
}
}
httpServerConnection.logout();
}
</script>
</html>
louis.liu - Sunday, May 20, 2012 11:02 PM:
David,
It seems that you are trying to create an independent Ajax Page to access Innovator
Maybe you can reference [AJAX toolkit for Browser Independent clients]
www.aras.com/.../project-view.aspx
Best Regards.
-Louis-
louis.liu - Monday, May 21, 2012 5:28 AM:
David
It seems you want to create an ajax client to access innovator
Please reference AJAX toolkit for Browser Independent clients
(http://www.aras.com/projects/project-view.aspx?id=0EE74C70EC52497D89B5D87D5F3B5881)
hope it helps
Best Regards
Brian - Monday, May 21, 2012 9:32 AM:
Hi David,
I'm pretty sure that you can't use the IOM.dll like that. It isn't an ActiveX object (someone correct me if I am wrong).
You could build an .aspx page that uses the IOM on the code behind page to connect and then you can retrieve information using the IOM.
Or you can see this project
aras.com/.../project-view.aspx
to get an idea of how to use the IOM from an external client.
Cheers,
Brian.
louis.liu - Wednesday, May 23, 2012 1:08 PM:
Hi, David
I am not sure where the error occurs,
if it occurs in creating activeXObject,You should copy iom.dll from innovatorclientcbin to the folder with your html page
then you should register the iom.dll using:
C:WindowsMicrosoft.NETFramework64v2.0.50727>regasm "C: estiom.dll" /tlb /codebase /verbose
if you can login innovator successfully,
you can try the following modified code:
<html>
<script LANGUAGE="JavaScript" TYPE="text/javascript">
var innServerURL = "localhost/.../InnovatorServer.aspx";
var dbID = 'InnovatorSolutions930';
var login = 'admin';
var password = 'innovator';
var iomFactory = new ActiveXObject("Aras.IOM.IomFactory.9.3");
var httpServerConnection = iomFactory.CreateHttpServerConnection(innServerURL, dbID, login, password);
var loginResult = httpServerConnection.login();
if (loginResult.IsError())
{
alert(loginResult.GetErrorDetail());
}
else
{
//var innovator = new Innovator();
var innovator = iomFactory.CreateInnovator(httpServerConnection);
var partItem = innovator.newItem();
var strAML="<AML><Item type='Part' action='add' >" +
"<item_number>888-456</item_number>" +
"<description>Blah blah</description>" +
"<Relationships>" +
"<Item type='Part BOM' action='add'>" +
"<quantity>10</quantity>" +
"<related_id>" +
"<Item type='Part' action='get'>" +
"<item_number>555-555</item_number>" +
"</Item>" +
"</related_id>" +
"</Item>" +
"</Relationships>" +
"</Item></AML>"
partItem.loadAML(strAML);
var resultItem = partItem.apply();
if (resultItem.isError())
{
//top.aras.AlertError (resultItem.getErrorDetail());
alert(resultItem.getErrorDetail());
}
}
httpServerConnection.logout();
</script>
</html>
Best Regards
-Louis-
davidchao - Friday, December 6, 2013 9:48 AM:
louis.liu - Thursday, December 12, 2013 12:17 AM:
Hi David
It seems the security setting of client PC goes wrong.
Please check www.aras.com/.../DocumentView.aspx
And you can change another Client PC to try to connect.