• JustAnotherAdmin
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Salesforce Admin

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi,
I can get the Object name with the following code but how can I get this objName using SOQL?
String objName = recId.getSObjectType().getDescribe().getName()
I'm using java/python code to call SOQLs for some other work (integration) I need to know the object names by record ids in Java/Python. Please advice
 
Hai friends,
i want to display all objects with its keyprefix values for this i done like this

in controller class:
public class GettingObjectsAndKeyPrifix {
    public List<Schema.SObjectType> gd {get;set;}
    public List<String> objectMap {get;set;}

     Public GettingObjectsAndKeyPrifix(){
        gd= Schema.getGlobalDescribe().Values();
        objectMap = new List<String>();
        for(Schema.SObjectType f : gd)
        {
            objectMap.add(f.getDescribe().getKeyPrefix());
        }
        System.debug('--------- --'+gd);
        System.debug('+++++++++ --'+objectMap.size() );
    }
}

in visual force page:
<apex:page controller="GettingObjectsAndKeyPrifix">
    <!--http://srinivas4sfdc.blogspot.in/2013/12/list-of-salesforce-object-key-prefixes.html-->
   <apex:pageBlock >
   <apex:pageBlockSection >
        <apex:pageBlockTable value="{!objectMap}" var="o">
        <apex:column value="{!o}"></apex:column>
        </apex:pageBlockTable>  
      <apex:pageBlockTable value="{!gd}" var="g">
    <apex:column value="{!g}"></apex:column>
    </apex:pageBlockTable>
  
    </apex:pageBlockSection>
   
     </apex:pageBlock>
   
</apex:page>

here output is comming ,but i want output like

account--001
Note-002
like this how can i please help.

i want ouput like this in url
http://srinivas4sfdc.blogspot.in/2013/12/list-of-salesforce-object-key-prefixes.html