• saasray
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Trying to figure out how I can prevent roll-back on Apex Batches for a Scheduled Class and then capture the id's and messages for the records that fail in an update call and email that out to an admin.  Documentation doesn't seem clear on this.

I'd appreciate input on the following use case which I would assume is a fairly common one.

 

I am building a customization project that uses objects from an installed managed package. As this is a long-term project I'm keeping the customizations in SVN via the Eclipse Force IDE. So for example, additional data fields that I add are nicely handled via the (package.xml) CustomField metadata component type in that they can be extracted from the org and then committed to SVN. But I'm puzzled about how to handle profiles, be they edits of the managed package ones or new ones created for the customization project.

 

Based on the documentation and posts such as this Failed to retrieve custom profile to Eclipse 3.3, the parts of the profile that are returned when the Profile metadata component type is used are filtered by the other items being retrieved. But In my case what I need is all the profile settings, both those for the components in the managed package (because I'm customizing which fields etc from that managed package are being shown and how), plus the profile settings for my added fields. All I get by default are the latter ones which are a small fraction of the total set I need.

 

I note that although the wildcard matching for members (the "*") does not match components in the managed package it is possible to explicitly name the items (where the names have to include the namespace prefix) so by explicitly naming all the components in the managed package it might be possible to also retrieve all the profile settings. But that is a scarily fragile way to go and leaves you with an Eclipse project where 99% of the files are unwanted ones just requested to cheat the API.

 

The only work-around I can think of is to write some Java code that uses the Metadata API to first identify all the components (both in the managed package and in the customization project), then requests them all, but ultimately throws everything away except the profiles. This might only take a few hours to do, but it would take a while longer to test to be sure that all the profile settings were included.

 

So if I've missed an obvious way to do this or if you have any other insight please comment.

 

Thanks,

Keith