Once you get your change order, you can access all related objects using the ChangeOrderGrp object:
//get all related entities of an ECO
Autodesk.Connectivity.WebServices.ChangeOrderService mCoSrvc = mVault.ChangeOrderService;
Autodesk.Connectivity.WebServices.ChangeOrder mCo = mCoSrvc.GetChangeOrderByNumber("ECO-000010");
Autodesk.Connectivity.WebServices.ChangeOrderGrp mCoGrp = mCoSrvc.GetChangeOrderGroupByChangeOrderId(mCo.Id);
//access related files or items (= Records Tab)
if (mCoGrp.FileIdArray != null)
{
Autodesk.Connectivity.WebServices.File[] mFiles = mVault.DocumentService.GetFilesByIds(mCoGrp.FileIdArray);
}
if (mCoGrp.ItemIdArray != null)
{
Autodesk.Connectivity.WebServices.Item[] mItems = mVault.ItemService.GetItemsByIds(mCoGrp.ItemIdArray);
}
//access attached files (= Files Tab)
if (mCoGrp.AttmtIdArray != null)
{
Autodesk.Connectivity.WebServices.File[] mAttdFiles = mVault.DocumentService.GetFilesByIds(mCoGrp.AttmtIdArray);
}
//access the ECO's communication thread (= Comments Tab)
Autodesk.Connectivity.WebServices.ForumService mFrmSrvc = mVault.ForumService;
Autodesk.Connectivity.WebServices.Msg[] mCoMsgs = mFrmSrvc.GetMessagesByForumId(mCoGrp.ForumId);
//access the ECO's communication thread (= Comments Tab) including files, attached to comments
Autodesk.Connectivity.WebServices.MsgGroup[] mCoMsgGrps = mFrmSrvc.GetMessageGroupsByForumId(mCoGrp.ForumId);
if (mCoMsgGrps !=null)
{
foreach (var mMsgGrp in mCoMsgGrps)
{
if (mMsgGrp.FileIdArray != null)
{
Autodesk.Connectivity.WebServices.File[] mCommentAttmts = mVault.DocumentService.GetFilesByIds(mMsgGrp.FileIdArray);
}
}
}
Markus Koechl
Solutions Engineer PDM, Autodesk Central Europe