scolladon / sfdx-git-delta

Generate the sfdx content in source format from two git commits
Other
405 stars 111 forks source link

Missing "Document" type/member when retrieving "EmailTemplate" with attachments #828

Closed VinceFINET closed 3 months ago

VinceFINET commented 3 months ago

Issue verification check:

What is the problem?

PR contains a new EmailTemplate with an attachment. Generated delta xml file with sfdx-git-delta (v5.34) does not include the attachment (type=Document). See metadata documentation refering to Document type when a template contains an attachment https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_emailtemplate.htm

What is the parameter and the value you used with it?

sf sgd:sf:delta -a 59 -t HEAD -f "xxxxxx" -r . -o . -i manifest/mdapi/.sgdignore

What is the expected result?

xml should include Document member to reflect the attachment of the template

What is the actual result?

xml does not contain the attachment the metadata api gives this error: Error unfiled$public/MutxxxxPxxxxx In field: documents - no Document named EmailTemplates/MutxxxxPxxxxx_attachment.pdf found

FYI @patferna-sfdx

VinceFINET commented 3 months ago

In parallel, we are checking if the "ignore" file could interfere with this issue. We will keep you posted!

scolladon commented 3 months ago

Hi @VinceFINET!

Thanks for raising this issue and thanks for contributing in making this project better!

If I understand properly, when deploying an email template the first time it refers to a previously deployed attachement, it fails because the deployment need the attachment to be part of the payload ?

Or does the email template and the document are created at the same time and for some reason the document is not treated in the incremental generation ?

VinceFINET commented 3 months ago

Same time yes. But @patferna-sfdx is suspecting that the ignore file excludes (for some reason) the /document/ folder so he will try to remove this and retry to deploy and see if that does change something.

is ignoring /document/ by default?

scolladon commented 3 months ago

By default there are no ignore

patferna-sfdx commented 3 months ago

Hi @scolladon ! I confirm that the ignore file was excluding "*/documents/". Removing this resolved the issue ! Thank you @scolladon for reactivity and @VinceFINET for help in investigation !!

scolladon commented 3 months ago

Thanks for the deep and fast investigation 😁 Happy incremental deployment