17

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 interesting 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 11/04/20:

The bug has been fixed on the Winter '20 Patch 7.0

Older Update: I've reported this case and Salesforce Support identified it as a bug:

[Deleting a custom field/object should remove references with force:source:pull][2]
Help to resolve this problem by clicking "This Issue Affects Me".
6
  • 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. Jan 24, 2018 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. Jan 24, 2018 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. Jan 25, 2018 at 9:16
  • @WadeWegner Yup, youre right :) Jan 25, 2018 at 9:17
  • 1
    @PrzemysławDługoszewski-Tamoń, I suggest you post your Update as an answer that solves the problem. Because your question still comes up when filtering for unanswered questions (with a very high score). Oct 28, 2023 at 15:51

1 Answer 1

1

According to Salesforce this bug was fixed in the Winter '20 Patch 7.0.

I can confirm it, as it was gone in my Developer Edition Org.

You must log in to answer this question.

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