<?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: Deleting links of files in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8752061#M5190</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that's because you're checking out the file before you call this method. When checking out a file a new version is already created. The GetLinksByTargetEntityIds method seems to need the id of the latest version of a file. Try&amp;nbsp;this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ACW.File latest = connection.WebServiceManager.DocumentService.GetLatestFileByMasterId(selectedFile.EntityMasterId);
ACW.Lnk[] links = connection.WebServiceManager.DocumentService.GetLinksByTargetEntityIds(new long[] { latest.Id });&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2019 07:56:25 GMT</pubDate>
    <dc:creator>psaarloos</dc:creator>
    <dc:date>2019-04-25T07:56:25Z</dc:date>
    <item>
      <title>Deleting links of files</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8749797#M5185</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I'm having problems deleting links to files in Vault 2019, using C#.&amp;nbsp;&lt;BR /&gt;I want to delete Selected link, but&amp;nbsp; I get original file's ID and other properties. I've tried using DocumentService methods to get links but methods return null values.&lt;BR /&gt;Any help getting link ID would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 11:23:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8749797#M5185</guid>
      <dc:creator>Saulius.Juskevicius</dc:creator>
      <dc:date>2019-04-24T11:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting links of files</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8749881#M5186</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should be able to get the Link ID's by using the&amp;nbsp;GetLinksByParentIds function in the DocumentService. Once you have the ID's you should be able to remove them by using the DeleteLinks method of the DocumentService.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps..&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 11:54:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8749881#M5186</guid>
      <dc:creator>psaarloos</dc:creator>
      <dc:date>2019-04-24T11:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting links of files</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8749933#M5187</link>
      <description>&lt;P&gt;Thanks for reply,&lt;BR /&gt;&lt;BR /&gt;But&amp;nbsp;&lt;SPAN&gt;GetLinksByParentIds method works by giving folderID and it finds all links inside that folder, but how do I get link's location, and not originals files location then?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is how I used this method.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Lnk[] links= _connection.WebServiceManager.DocumentService.GetLinksByParentIds(new long[] { selectedFile.Id }, new string[] { "FILE" });
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 12:16:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8749933#M5187</guid>
      <dc:creator>Saulius.Juskevicius</dc:creator>
      <dc:date>2019-04-24T12:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting links of files</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8750721#M5188</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case you might want to use&amp;nbsp;GetLinksByTargetEntityIds and pass in the file Id. You'll get a link collection back which tell you what the parent entity class id and parent id is. See image below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Debug.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/629526i1933E5967BD10E86/image-size/large?v=v2&amp;amp;px=999" role="button" title="Debug.png" alt="Debug.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 16:21:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8750721#M5188</guid>
      <dc:creator>psaarloos</dc:creator>
      <dc:date>2019-04-24T16:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting links of files</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8751846#M5189</link>
      <description>&lt;P&gt;I've tried this method but it returns null. Here's code how I get the selected file. And then I create FileIteration object.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt; foreach (ISelection item in e.Context.CurrentSelectionSet)
                {
                    ISelection selection = item;
                    File selectedFile = null;&lt;BR /&gt;
                    if (selection.TypeId == SelectionTypeId.File)
                    {          
                        selectedFile = mDocSvc.GetLatestFileByMasterId(selection.Id);
                    }&lt;BR /&gt;                 }&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/629733i57D8B2F615A2EA6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 05:05:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8751846#M5189</guid>
      <dc:creator>Saulius.Juskevicius</dc:creator>
      <dc:date>2019-04-25T05:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting links of files</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8752061#M5190</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that's because you're checking out the file before you call this method. When checking out a file a new version is already created. The GetLinksByTargetEntityIds method seems to need the id of the latest version of a file. Try&amp;nbsp;this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ACW.File latest = connection.WebServiceManager.DocumentService.GetLatestFileByMasterId(selectedFile.EntityMasterId);
ACW.Lnk[] links = connection.WebServiceManager.DocumentService.GetLinksByTargetEntityIds(new long[] { latest.Id });&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 07:56:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8752061#M5190</guid>
      <dc:creator>psaarloos</dc:creator>
      <dc:date>2019-04-25T07:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting links of files</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8752322#M5191</link>
      <description>&lt;P&gt;Yeah, the problem was that I checked the file out before attempting using the methods.&amp;nbsp;&lt;BR /&gt;Now I can delete links but how could I delete only the specific one because now I delete all links for file.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 10:31:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8752322#M5191</guid>
      <dc:creator>Saulius.Juskevicius</dc:creator>
      <dc:date>2019-04-25T10:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting links of files</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8752490#M5192</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would need to loop through the Lnk collection and look at the Lnk properties te determine if that's the link you are looking for. You might need to call some other methods to parse in the FLDR id (ParentId property of the Lnk) for example to find out which folder the link is refering to.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 11:56:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/deleting-links-of-files/m-p/8752490#M5192</guid>
      <dc:creator>psaarloos</dc:creator>
      <dc:date>2019-04-25T11:56:51Z</dc:date>
    </item>
  </channel>
</rss>

