1

How do you correctly insert documents (more specifically images in a document) in the package.xml manifest.

Scenario: I am trying to create an unlocked package and with that package, I would like to insert my company's logo so that I can reference that image onto custom tabs.

Below is what I have declared. When I retrieve it from the org, I see the document in scope populate but when I go to create the package I get the following error (the folder logo does not exist)

Is my sytax correct? The folder is called Logo and the image is called Logo.

<types>
   <members>Logo</members>
   <members>Logo/Logo.jpg</members>
   <name>Document</name>

enter image description here

3
  • 1
    I think the package manifest is correct, but you would need to have your Logo folder metadata (file that would end in -meta.xml and contain the metadata for that folder) in your documents folder. Did the folder download when you performed the retrieve? Commented Nov 4, 2022 at 16:53
  • @PhilHawthorn I believe with the attached image I just edited the OP with shows that it was retrieved correctly. It is just weird that when I go to create the package, I get the error. Appreciate your feedback!
    – andrew
    Commented Nov 7, 2022 at 18:05
  • That folder looks to be is sfdx format, whereas I think you're trying to deploy in metadata format? If that is the case, i think the folder metadata file would be Logo-meta.xml. If you want to deploy as-is, use sfdx force:source:deploy (you don't then need package.xml) Commented Nov 8, 2022 at 9:16

1 Answer 1

1

This is what ended up working for me after a bit of trial and error.

folder structure (make sure Logo-meta.xml is inside documents directory and Logo.jpg-meta.xml is inside the Logo directory)

package.xml
documents/
 | 
 | -- Logo-meta.xml
 | -- Logo/
      | -- Logo.jpg
      | -- Logo.jpg-meta.xml
 

package.xml

<types>
   <members>Logo</members>
   <members>Logo/Logo.jpg</members>
   <name>Document</name>
</types>

Logo-meta.xml

<?xml version="1.0" encoding="UTF-8"?>
<DocumentFolder xmlns="http://soap.sforce.com/2006/04/metadata">
    <accessType>Public</accessType>
    <name>Logo</name>
    <publicFolderAccess>ReadOnly</publicFolderAccess>
</DocumentFolder>

Logo/Logo.jpg-meta.xml

<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="http://soap.sforce.com/2006/04/metadata">
    <name>Logo</name>
    <internalUseOnly>true</internalUseOnly>
    <public>false</public>
</Document>
3
  • Are you saying that I have to creates two additional XML files and then add them to under where my Package.XML file lives locally? Appreciate the help!
    – andrew
    Commented Jan 9, 2023 at 22:51
  • yes you have to create 2 xml files.. one lies within documents folder and the other lies within documents/logo folder @andrew
    – SatheeshJM
    Commented Jan 10, 2023 at 9:35
  • I have updated the folder structure in the answer to make it clearer
    – SatheeshJM
    Commented Jan 10, 2023 at 10:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .