4

I'm noticing that every time I spin up a new scratch org, I lose the page layout assignments I've specified for each of my Product2 recordtypes.

Is page layout assignment something that's supposed to be included in my SFDX project source? If so, does anybody have any ideas about why that isn't being pulled down when I do a force:source:pull? And if not, has anyone come up with any workarounds for this issue?

3
  • Did you pull the Profile object as well? If not, then that would be an expected behavior.
    – sfdcfox
    Commented Dec 14, 2017 at 23:22
  • I didn't think it was possible not to. I understood that force:source:pull is going to pull all the custom metadata in a scratch org regardless of type. Is there something specific I need to do to reference specific metadata types?
    – AGallinat
    Commented Dec 14, 2017 at 23:51
  • @AGallinat Did you find out how to get the layout assignment metadata? Commented Jan 22, 2019 at 14:14

2 Answers 2

3

I noticed that to get layout assignment you have to specify that you want to retrieve Profile, Layout, RecordType and CustomObject at the same time. You may also want to provide your_custom_object, like this:

sfdx force:source:retrieve -m Profile,Layout,RecordType,CustomObject:your_custom_object
2

For some reason, changing page layout assignments isn't detected by sfdx force:source:status or pull. I got the whole profile metadata using

sfdx force:source:retrieve -m Profile

Then snipped out everything except the layoutAssignments snippet(s) I wanted.

1
  • 1
    Any idea why both sfdx force:source:retrieve and sfdx force:mdapi:retrieve aren't giving me the layoutAssignments? Commented Apr 6, 2021 at 1:02

You must log in to answer this question.

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