<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Re-Write FileBom with &amp;quot;SetBomByFileId&amp;quot; throws error code &amp;quot;1145&amp;quot; in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/11936206#M5583</link>
    <description>&lt;P&gt;I actually was able to get this to work. So, you actually can manipulate the Vault underlying BOM using the API.&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 13:18:58 GMT</pubDate>
    <dc:creator>ThomasRambach</dc:creator>
    <dc:date>2023-05-02T13:18:58Z</dc:date>
    <item>
      <title>Re-Write FileBom with "SetBomByFileId" throws error code "1145"</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/8507845#M5578</link>
      <description>&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;community,&lt;/P&gt;
&lt;P&gt;I have used&amp;nbsp;SetBomByFileId to re-write the FileBom.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The new FileBom is the same&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;like&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the old one but I have removed just 1 component from the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;CompArray.&lt;/P&gt;
&lt;P&gt;The function&amp;nbsp;"SetBomByFileId" throws the error code "1145", but I can nowhere locate the appropriate&amp;nbsp;error message for this code. Where can I find it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;Real Problem&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;EM&gt;GetBOMByFileId&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;returns Components with XRefIds which do&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;exist in Vault anymore.&lt;/DIV&gt;
&lt;DIV class="copy-paste-block"&gt;After running the Autodesk Job&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN&gt;autodesk.vault.extractbom.inventor&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;on the affected Assembly doesn't write a new&amp;nbsp;FileBom&amp;nbsp;like mentioned in t&lt;A tabindex="-1" title="https://blog.coolorange.com/2017/05/26/fixing-the-bom-blob/" href="https://blog.coolorange.com/2017/05/26/fixing-the-bom-blob/" target="_blank" rel="noreferrer noopener"&gt;his blog post&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="copy-paste-block"&gt;The API documentation for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;SetBomByFileId (which the job should use)&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;says&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;"&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;File cannot have a BOM already associated with it."&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="copy-paste-block"&gt;Does this mean the job fixes the FileBom only in case there is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;NO&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;bom&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;at all?&lt;/DIV&gt;
&lt;DIV class="copy-paste-block"&gt;Is there a better way in my case where only some XRefIds are wrong&amp;nbsp;&lt;STRONG&gt;without&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;making a check-in with Inventor?&lt;/DIV&gt;
&lt;DIV class="copy-paste-block"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="copy-paste-block"&gt;&lt;STRONG&gt;Had somebody else a similar case? Any help is very appreciated&amp;nbsp;thanks!&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV class="copy-paste-block"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="copy-paste-block"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Jan 2019 16:12:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/8507845#M5578</guid>
      <dc:creator>Patrick.Gruber</dc:creator>
      <dc:date>2019-01-08T16:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Re-Write FileBom with "SetBomByFileId" throws error code "114</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/8508166#M5579</link>
      <description>&lt;P&gt;Hi Patrick,&lt;/P&gt;
&lt;P&gt;I'd like to clarify the base concept first, even I can't quickly all your question details.&lt;/P&gt;
&lt;P&gt;The Job "Extract Item Data" (User command in Vault Professional, Actions-&amp;gt;Extract Item Data) runs only if no BOM data exists for the component. It is NOT applicable to update/correct existing BOM data. The only supported path to update existing BOM data in Vault Professional is checking in the file using Inventor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 17:53:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/8508166#M5579</guid>
      <dc:creator>Markus.Koechl</dc:creator>
      <dc:date>2019-01-08T17:53:21Z</dc:date>
    </item>
    <item>
      <title>Re: Re-Write FileBom with "SetBomByFileId" throws error code "1145"</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/11923938#M5580</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/33301"&gt;@Markus.Koechl&lt;/a&gt;&amp;nbsp; In all the example code I've seen for checking in a file through the API it uses:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;public override File CheckinUploadedFile( 
   System.long fileMasterId,
   System.string comment,
   System.bool keepCheckedOut,
   System.DateTime lastWrite,
   FileAssocParam[] associations,
   BOM bom,
   System.bool copyBom,
   System.string newFileName,
   FileClassification fileClassification,
   System.bool hidden,
   ByteArray uploadticket
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where the BOM is set to NULL and copyBom is set to True. This works well. However, we have part of our code instances where the Inventor BOMStructure is updated from Normal to Purchased as part of the Job Processor job. So, we've discovered that now that we're utilizing Items, some of the BOMS do not match what the file really is set to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, I haven't seen any examples of code where when you check-in a file, how do you read in the latest BOM information from the file that was uploaded? Is there a way to manipulate the BOMStructure value for a component in a BOM and then associate the manipulated BOM to the file being uploaded?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 17:51:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/11923938#M5580</guid>
      <dc:creator>ThomasRambach</dc:creator>
      <dc:date>2023-04-26T17:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Re-Write FileBom with "SetBomByFileId" throws error code "1145"</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/11927121#M5581</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/48931"&gt;@ThomasRambach&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;creating/updating the BOM object is reserved for the Inventor-Vault Addin. The Add-In does not provide an API that we could leverage.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 22:48:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/11927121#M5581</guid>
      <dc:creator>Markus.Koechl</dc:creator>
      <dc:date>2023-04-27T22:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Re-Write FileBom with "SetBomByFileId" throws error code "1145"</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/11928014#M5582</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/33301"&gt;@Markus.Koechl&lt;/a&gt;&amp;nbsp;What's strange is you can read the info but not change it. Do you think this is something the API may provide in the future?&lt;/P&gt;&lt;LI-CODE lang="general"&gt;// Get the File BOM
ACW.BOM fBOM = DocSrvc.GetBOMByFileId(fFileID);

// Read the parent assembly BOM Structure
ACW.BOMStructureEnum fCompBOMStruct = fBOM.CompArray[0].BOMStruct;

// I can even change the assembly BOM structure
fBOM.CompArray[0].BOMStruct = ACW.BOMStructureEnum.Purchased;

// I just can't reassociate the modified BOM back to the file &lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Apr 2023 10:51:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/11928014#M5582</guid>
      <dc:creator>ThomasRambach</dc:creator>
      <dc:date>2023-04-28T10:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Re-Write FileBom with "SetBomByFileId" throws error code "1145"</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/11936206#M5583</link>
      <description>&lt;P&gt;I actually was able to get this to work. So, you actually can manipulate the Vault underlying BOM using the API.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 13:18:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/re-write-filebom-with-quot-setbombyfileid-quot-throws-error-code/m-p/11936206#M5583</guid>
      <dc:creator>ThomasRambach</dc:creator>
      <dc:date>2023-05-02T13:18:58Z</dc:date>
    </item>
  </channel>
</rss>

