I have a Salesforce Service enabled Sandbox and I have created some messaging templates in Service Setup/Home/Channels/Messaging/Messaging Templates. I need to retrieve metadata related to those Templates to vs code using sfdx. How can I modify my package.xml to achieve that?
Add the MessagingTemplate object to your package:
<types>
<members>*</members>
<name>MessagingTemplate</name>
</types>
-
Im getting this error: ERROR running force:source:retrieve: Element {soap.sforce.com/2006/04/metadata}type invalid at this location – YanetP1988 May 13 '20 at 13:32
-
-
hahah, no problem. Still, now this: === WARNING: The following metadata isn’t in your org. If it’s not new, someone deleted it from the org. Entity type: 'MessagingTemplate' is unknown – YanetP1988 May 13 '20 at 13:53
-
1@YanetP1988 Interesting. I need to some research on this. It doesn't appear in my dev org. – sfdcfox May 13 '20 at 13:53
-
I've been doing some research and it seems that it is not supported by Metadata API – YanetP1988 May 15 '20 at 15:49
Since it seems that it is not supported by Metadata API, I have found a workaround, with Workbench I queried object Messaging Template:
SELECT DeveloperName,MasterLabel,Message FROM MessagingTemplate
Then in VS Code, exported that result as a JSON file and imported on my other sandbox.
sfdx force:data:tree:export -q "<SOQL query>" -d "<exported file path>"
sfdx force:data:tree:import -f "<exported file path>"