1

Spinning up new orgs, our team is wasting a significat beef of time simply to cleanup the sample-data you get rolling into new vanilla orgs...

Personally I think as partners we should get the option to spin orgs empty - but if we have to stick with the sample-data, we would like to have a one-step killer command, which wipes out everything.

First I looked into Resetting my development org to an empty state - which is a good start but unfortunately a multistep process.

Then I found https://github.com/financialforcedev/df12-deployment-tools - which is really cool! Running ant undeploy deletes all custom fields and more, which is a great help so far.

Unfortunately additional page layouts survive the script and I'm not really sure why. Looking at the code, it seems that Layouts are covered, e.g. at line 178 they get queried:

<types>
   <members>*</members>
   <name>Layout</name>
</types>

But I'm not really sure they are processed - or if they are deletable this way at all. In eclipse, deleting page layouts result only in a local deletion and in the UI we run into the annoying replace-dialog when we want to delete them.

Is it possible to extend the undeploy.xml to get rid of any additional layouts? If so, what needs to be changed?

1
  • hey, I work on gearset.com and although I don't think we will do quite what you need yet, your use case is definitely on our radar. Would you be willing to have a call to speak about what you guys need in more detail? Commented Mar 31, 2015 at 1:55

1 Answer 1

0

Actually you can.

First it's not true that you can't do it with eclipse. It works, just avoid the mistakte to "work offline" as I did. By some reason new project come up "offline" and I jump always in this trap. Just righclick on

your project > Force.com > Work Online

and eclipse deletes Layouts without a problem.

Second in undeploy.xml it works, too. Search for

  <antcall target="generatePackageMembers">
    <param name="objtyp"  value="CustomPageWebLink" />
    <param name="objext"  value="weblink" />
    <param name="objdir"  value="weblinks" />
    <param name="objflt"  value="*" />
  </antcall>

After that at about line 360 just add the following lines:

  <antcall target="generatePackageMembers">
    <param name="objtyp"  value="Layout" />
    <param name="objext"  value="layout" />
    <param name="objdir"  value="layouts" />
    <param name="objflt"  value="*Opportunity*%*" />
  </antcall>
  <antcall target="generatePackageMembers">
    <param name="objtyp"  value="Layout" />
    <param name="objext"  value="layout" />
    <param name="objdir"  value="layouts" />
    <param name="objflt"  value="*Lead*%*" />
  </antcall>
  <antcall target="generatePackageMembers">
    <param name="objtyp"  value="Layout" />
    <param name="objext"  value="layout" />
    <param name="objdir"  value="layouts" />
    <param name="objflt"  value="*Account*%*" />
  </antcall>
  <antcall target="generatePackageMembers">
    <param name="objtyp"  value="Layout" />
    <param name="objext"  value="layout" />
    <param name="objdir"  value="layouts" />
    <param name="objflt"  value="*Case*%*" />
  </antcall>
  <antcall target="generatePackageMembers">
    <param name="objtyp"  value="Layout" />
    <param name="objext"  value="layout" />
    <param name="objdir"  value="layouts" />
    <param name="objflt"  value="*Contact*%*" />
  </antcall>

run ant undeploy again

You must log in to answer this question.

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