Uploading Files

Hi

I was trying to create a file and add to document item type using an AML query but getting File Item cannot be added

<AML>
<Item type="Document" action="add">
<item_number>TEST</item_number>
<name>Hi</name>
<Relationships>
<Item type="Document File" action="add">
<related_id>
<Item type="File" action="add">
<filename>1.txt</filename>
<checkedout_path>C:\Backup\1\1.txt</checkedout_path>
<actual_filename>1.txt</actual_filename>
<file_type>3F3FCF1E77CB48F384F1A1FADD5F45E4</file_type>
<Relationships>
<Item type="Located" action="add">
<related_id>67BBB9204FE84A8981ED8313049BA06C</related_id>
</Item>
</Relationships>
</Item>
</related_id>
</Item>
</Relationships>
</Item>
</AML>

Could you please help on this issue

Parents
  • I know this is an old thread but for anyone in the future looking for how to add File Items via AML, here is how I was able to get it to work in Aras v12SP18:

        <Item type='File' action='add' id='New32GUID'>
          <actual_filename>C:\Path\to\MyFile\filename.pdf</actual_filename>
          <checkedout_path>C:\Path\to\MyFile</checkedout_path>
          <filename>filename.pdf</filename>
          <Relationships>
            <Item type='Located' action='add'>
              <related_id>32GUIDofVaultItemType</related_id>
            </Item>
          </Relationships>
        </Item>

    The key for me to get past the "File Item cannot be added" error was to ensure the "id" attribute in the beginning had a new unique 32 character GUID.

Reply
  • I know this is an old thread but for anyone in the future looking for how to add File Items via AML, here is how I was able to get it to work in Aras v12SP18:

        <Item type='File' action='add' id='New32GUID'>
          <actual_filename>C:\Path\to\MyFile\filename.pdf</actual_filename>
          <checkedout_path>C:\Path\to\MyFile</checkedout_path>
          <filename>filename.pdf</filename>
          <Relationships>
            <Item type='Located' action='add'>
              <related_id>32GUIDofVaultItemType</related_id>
            </Item>
          </Relationships>
        </Item>

    The key for me to get past the "File Item cannot be added" error was to ensure the "id" attribute in the beginning had a new unique 32 character GUID.

Children
No Data