0

my use case : fix reports in bulk when there is a change, such as a replacement on opportunity stage.

note: we do not use source tracking - we use sandboxes for development.

first, i download all reports using the salesforce package generator extension in vscode.

then i run force:source:tracking:reset because i do not want to push all reports, just the modified ones

then i do find/replace in the reports folder to make the changes

and then i do force:source:push and only the modified reports are pushed to the sandbox.

now i want to push only the modified reports to production - not all the thousands of reports in the reports folder.

I have been able to do this using devops center. I use sfdx force:source:push to a source tracked sandbox, and then deployed to prod via devops center, but i would prefer to do it all via sfdx, but cant figure out how to just include the modified reports.

I tried using sfdx force:source:convert to create a package, but it contained all reports, not just the ones I modified.

I suppose I could do some command line kung fu to generate a list of modified files, but feels like I'm missing something obvious.

thanks

1 Answer 1

0

I think you are looking for sfdx-git-delta , that can generate a package.xml from the diff between 2 commits, that will contain only the metadatas that has been created or updated since the previous commit

If you want an easier way to use it, the command is available in VsCode SFDX Hardis like in screenshot below

enter image description here

After running sfdx-git-delta , you can manually update the package.xml to keep only the block with <name>Report</name> , then call sfdx force:source:deploy -x yourpackage.xml -u yourproductionorguser

2
  • Thanks for the insight. Glad to know I'm not missing anything obvious. May explore a script to delete files based on last modified date, as we are just using vscode and sandbox, and are not using source control/git. I will update the title to reflect this.
    – gorav
    Jan 17 at 12:12
  • You really should use git :) if you need to know how, you can read this article:) salesforcedevops.net/index.php/2023/03/01/… Mar 5 at 1:38

You must log in to answer this question.

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