2

I would like to know if there is Standard SObject for Changeset or Package? I noticed that 033 is prefix for Package and 0A2 is key prefix for Changeset. However, neither of there objects are not exposed through API or SOQL. I tried this code to run but it returns nothing for 0A2 or 033.

Is there any reason why SFDC doesn't want to make these objects public for SOQL?


Update: also I am interested in 034 which looks like prefix for package component.

Using Adrian Larson's code, it gives PackageMember

system.debug(LoggingLevel.ERROR, Id.valueOf('03423000000MFWY').getSObjectType());

1 Answer 1

4
  • The key prefix 0A2 corresponds to the DevelopmentPackageVersion object.
  • The key prefix 033 corresponds to the AllPackage object.

A more comprehensive (and significantly faster, I imagine) methodology for taking a key prefix or Id is this fairly simple approach:

system.debug(Id.valueOf('0A2000000000000').getSObjectType());
system.debug(Id.valueOf('033000000000000').getSObjectType());

Given the prefix only, you can right-pad with zeroes until you get to 15 digits and you will get the same result as if you copy-pasted the whole id.

6
  • you are totally right , I am fool that I didn't find this myself
    – Patlatus
    Commented Sep 7, 2016 at 11:14
  • Eh that's being too hard on yourself. As for why these objects are not publicly documented or available for query, I'm not sure, but I'm hardly surprised, either.
    – Adrian Larson
    Commented Sep 7, 2016 at 11:16
  • Actually knowing the sobject name doesn't help me much, still when I try to make SOQL query (either usual or "Use Tooling API"), it says that "sObject type 'DevelopmentPackageVersion' is not supported." or "sObject type 'AllPackage' is not supported."
    – Patlatus
    Commented Sep 7, 2016 at 11:30
  • Yeah, I do not believe you actually can query for them, but that's a slightly different question in and of itself, apart from identifying the objects represented by those Ids. I did a bit of searching but didn't find anything just yet.
    – Adrian Larson
    Commented Sep 7, 2016 at 11:37
  • 1
    Yeah, I imagine so. Might take a few years to get any traction. :(
    – Adrian Larson
    Commented Sep 7, 2016 at 11:49

You must log in to answer this question.

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