Vault Customization

Vault Customization

Reply
Mentor
FarrenYoung
Posts: 264
Registered: ‎07-13-2009
Message 1 of 4 (208 Views)

When to use GetBOMByFileIds vs GetFileAssociationsByIds

208 Views, 3 Replies
05-18-2012 04:13 PM

I am working on some code that uses GetBOMByFileIds and it isn't giving me the results I expect.  It's basically giving me the very first version of some files.  When I look at the "Uses" tab in vault for the same version of the parent file (assembly) it shows a much newer version.  I am wondering what the difference between GetBOMByFileIds and GetFileAssociationsByIds is?  When should each be used?  Would I get the same results with both or would GetFileAssociationsByIds show me the same results I see in the "Uses" tab?

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Mentor
FarrenYoung
Posts: 264
Registered: ‎07-13-2009
Message 2 of 4 (185 Views)

Re: When to use GetBOMByFileIds vs GetFileAssociationsByIds

05-23-2012 02:15 PM in reply to: FarrenYoung

Is it possible someone from autodesk that knows about this could respond? I see newer messages answered and my message just gets pushed farther down the list...

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Active Contributor
Chris_Rogers
Posts: 44
Registered: ‎06-22-2009
Message 3 of 4 (182 Views)

Re: When to use GetBOMByFileIds vs GetFileAssociationsByIds

05-23-2012 02:18 PM in reply to: FarrenYoung

I would like to know the same thing!  Bump for an Autodesk response.

-Chris Rogers
Inventor Certified Professional
________________________________________________________
If this post helps, please click the "Thumbs up"/"Kudos"
If this post gives the solution, please click "Accept as Solution"
Employee
Daniel.Dulzo
Posts: 61
Registered: ‎05-25-2011
Message 4 of 4 (170 Views)

Re: When to use GetBOMByFileIds vs GetFileAssociationsByIds

05-25-2012 02:25 PM in reply to: FarrenYoung

Hi Farren Young,

 

The GetFileAssociationsByIds() method reads relationship data that is directly stored in Vault. This is the data that you provide via the associations parameter in the CheckinFile() method. The GetBOMByFileIds() method gets BOM metadata that is really only intended for use with items and is stored seperately in BOM blobs in Vault, so it's possible that the two could return different file versions, however, you really should be using GetFileAssociationsByIds() when trying to get File associations.

 

The reason your "Uses" tab might look different that the data you get back with these methods is because the server actually provides multiple methods for getting file references that behave slightly different. For versions of Vault that support revisions, you can get file relationships that are "released bias". The other "versions" of the GetFileAssociationsByIds() methods are GetRevisionFileAssociationsByIds() and GetRevisionFileAssociationsByIds2().



Daniel Dulzo
Software Engineer
Autodesk, Inc.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.