You need to sign in to do that
Don't have an account?
SFDX pull error re: platform event translation
I created a Platform Event in my scratch org. When I try to pull it into source, I get the error:
I tried to .forceignore it, no-go. I can't pull the other things from my scratch org in that I need. I don't know where/how to fix this in the scratch org. I'm stuck...
ERROR: Cannot retrieve translation for object:[my platform event name].Translation is not enabled on the scratch org, and I don't need it.
I tried to .forceignore it, no-go. I can't pull the other things from my scratch org in that I need. I don't know where/how to fix this in the scratch org. I'm stuck...
Here's a fix from within the scratch org.
This is an old question but I just had this problem so here's hoping I help someone else who puts a lot of time into building in the UI and then edits the API name of their Platform Event before pulling the source:
I was able to recover from this by marking the translation as obsolete in the SourceMember table/object.
Open the developer console from the scratch org, check the box "Use Tooling API" and execute the query:
SELECT Id,ChangedBy,IsNameObsolete,MemberIdOrName,MemberName,MemberType,RevisionCounter,RevisionNum From SourceMember where isNameObsolete=false
Then I looked for a row with a MemberType of customObjectTranslation and edited it's isNameObsolete value to be true (check the box) and clicked "Save Rows".
At that point sfdx force:source:pull worked.
I got the hint about the SourceMember table from this page: https://groups.google.com/a/illuminatedcloud.com/forum/#!topic/qanda/AJYQPpoUGzo
All Answers
Additionally, what steps did you take to create the platform event in your org? I created a very simple one with no customizations and it pulled for me.
In order to use .forceignore for entities in the org, we have recently updated our documentation on how to format it correctly - see the section titled "Exclude Remote Changes Not Yet Synced with Your Local Source" here: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
Here are the plugins. Not sure if that's the same as back in July when I made my original post.
Thanks for the Exclude link. That's been in need of further documentation.
**objectTranslations
Doc_Submitted__e.objectTranslation
Any idea what I am missing?
If you want to exclude a specific file, I think you have to have the full file path:
I know it should already be excluded by the **objectTranslations.
It seems weird to have a __e (event) file in objectTranslations anyway.
I created a platform event with 3 fields, a text field, checkbox, and long text. When I try to pull I get an error, Cannot retrieve translation for object:Message.
Has anyone found a solution for this?
This is the result of sfdx plugins --core
@salesforce/plugin-generator 1.0.1 (core)
@salesforce/sfdx-trust 2.1.0 (core)
builtins 1.0.0 (core)
salesforcedx 45.5.0 (core)
Lucky for me, I have an Illuminated Cloud license, and Illuminated Cloud very recently released a feature which enables performing a retrieve operation using the Metadata API and then transforming and merging it into an SFDX-formatted project structure. So, I am able to use this as a workaround for "sfdx force:source:pull".
But, without that, I would be totally unable to develop my SFDX project after creating a single Platform Event in my org.
It would be nice if Salesforce open-source the SFDX CLI tool to empower me to resolve this issue on my own without needing to wait for the DX product team to release a fix.
I created a Contract_Doc_Uploaded__e platform event but I have no idea why or what created the translation metadata. So I tried to get the Contract_Doc_Uploaded-en_US with sfdx force:mdapi:retrieve but that did not retrieve anything either. I suppose 'pull' uses the same command behind the scenes.
I have added the following entries to .forceignore:
Non of these entries seem to stop de pull command from trying to pull the blocking object.
So I am stuck. Obviously I could retrieve the other changes with MDAPI, convert to sfdx format and create a new scratch but I am affraid I will keep running into this issue every time I create a new platform event.
I can create fields, update them, no problems pulling and pushing.
As soon as I changed the platform event API name, using the UI, I could not pull anymore. Even deleting the event and trying to pull doesn't work. The only option was to delete the scratch org and start over.
I can change the name by changing the metadata on my computer and pushing back to the scratch org. This seems to work with no issues.
The only issue is changing the platform API name using the UI.
Until Salesforce fixes this the workaround is to change the API name in the metadata.
You can change the label with no problems.
Hopefully, this will help someone in the future.
Here's a fix from within the scratch org.
This is an old question but I just had this problem so here's hoping I help someone else who puts a lot of time into building in the UI and then edits the API name of their Platform Event before pulling the source:
I was able to recover from this by marking the translation as obsolete in the SourceMember table/object.
Open the developer console from the scratch org, check the box "Use Tooling API" and execute the query:
SELECT Id,ChangedBy,IsNameObsolete,MemberIdOrName,MemberName,MemberType,RevisionCounter,RevisionNum From SourceMember where isNameObsolete=false
Then I looked for a row with a MemberType of customObjectTranslation and edited it's isNameObsolete value to be true (check the box) and clicked "Save Rows".
At that point sfdx force:source:pull worked.
I got the hint about the SourceMember table from this page: https://groups.google.com/a/illuminatedcloud.com/forum/#!topic/qanda/AJYQPpoUGzo