13

Salesforce DX does not track some of the changes I make on my scratch org.

How to reproduce a problem:

  1. Create a custom profile -> sfdx force:source:pull
  2. Create a custom object -> sfdx force:source:pull
  3. Delete a custom object -> sfdx force:source:pull
  4. sfdx force:source:status shows no problems

Then an interesing thing might be observed - opening a new scratch org and pushing a source there causes the following error:

PROJECT PATH ERROR ─────────────────────────────────────── ──────────────────────────────────────────────── force-app\main\default\profiles\My Custom Profile.profile-meta.xml In field: field - no CustomObject named Custom_Object__c found

The problem is that in the "My Custom Profile.profile-meta.xml" file there's still a <layoutAssignments> section which I have to delete manually:

<layoutAssignments>
  <layout>Custom_Object__c-Custom Object Layout</layout>
</layoutAssignments>

My question is: Can I make SFDX to track these changes somehow?

PS Another thing is that it looks like a bug a bit but I'm just not sure.

Update: I've reported this case and Salesforce support indentified it as a bug: Deleting a custom field/object should remove references with force:source:pull Help to resolve this problem by clicking "This Issue Affects Me".

  • 2
    This isnt really an answer so I will comment but I run into this issue a lot when working with sfdx. It happens whenever I delete a custom field. I have to go through the xml files manually and remove the references and then it seems to work. It only seems to happen to me on delete though. I figure it is a bug. Maybe we should open an issue since it seems to be something that is happening to multiple people. – Zack Walton Jan 24 '18 at 15:37
  • Question: when you say "opening a new scratch org and pulling a source there" do you mean pushing source? Not sure what you'd pull from a newly created scratch org. – Wade Wegner Jan 24 '18 at 17:14
  • 3
    @ZackWalton As I said - I wasn't sure about that but since I know it affects more people I've decided to report a bug. – notmyf4ulty Jan 25 '18 at 9:16
  • @WadeWegner Yup, youre right :) – notmyf4ulty Jan 25 '18 at 9:17
  • I've updated status of the case – notmyf4ulty Feb 12 '18 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.