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());
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.

  • you are totally right , I am fool that I didn't find this myself – Patlatus Sep 7 '16 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 Sep 7 '16 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 Sep 7 '16 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 Sep 7 '16 at 11:37
  • 1
    Yeah, I imagine so. Might take a few years to get any traction. :( – Adrian Larson Sep 7 '16 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.