• Exleaz
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi

I want to retrieve all datacategory object data i.e, groups and sub groups into a picklist.How can i acheive it,i have an idea i.e,by dynamic apex ....but its not working.can,you suggest anyhing for getting all datacatageroies into a picklist.

Hi

    i try to retrieve all sobjects in a picklist based on that picklist,we are getting all fields in another picklist.for this i wrote a logic. Actually am getting an error,can you please check it out:

 

System.NullPointerException: Attempt to de-reference a null object
Class.dynamicApex5.getselectfields: line 34, column 1

Here is my code:


Apex class:

public class dynamicApex5 {

   public list<SelectOption> selectedobject { get; set; }

    public String objectName { get; set; }
    
Map<string,schema.SobjectType> gd=schema.getGlobalDescribe();
    
    public dynamicApex5(){
                selectedobject = new list<SelectOption>();  
                  selectedobject.add(new selectoption('','-None-'));
                  list<schema.SobjectType> lst=gd.values();
                  for(schema.SobjectType ss:lst){
                      selectedobject.add(new selectoption(ss.getDescribe().getLocalName(),ss.getDescribe().getLabel()));
                      selectedobject.sort();
                      
                      stringfieldName=new List<String>();
                        offset=0;
                        pageNumber=0;
                        totalPage =0;
                  }
    }
    
      Map<String,Schema.SobjectField> fieldsMap;
      Schema.SobjectType sobj;
      public String fields { get; set; }
      
      public list<Selectoption> getselectfields() {
          list<selectoption> lsps=new list<selectoption>();
          if(objectName!=''){
                 sobj=gd.get(objectName);
                 system.debug('Object Names is '+sobj);                 
                 schema.DescribeSobjectResult all=sobj.getDescribe();
                 system.debug('Error is'+all);
                 fieldsMap=new Map<String,Schema.SobjectField>();
                 fieldsMap=all.fields.getMap();
                     for(Schema.SobjectField flds:fieldsMap.Values()){
                         lsps.add(new selectoption(flds.getDescribe().getName(),flds.getDescribe().getLabel()));
                         lsps.sort();
                     }
                   
                }
      return lsps;
      }

 

V.F:

---

<apex:page controller="dynamicApex5">
 <apex:form id="theForm">
     <apex:pageBlock title="Select Object and Fields">
         <apex:pageBlockSection title="Select an Object" collapsible="false" columns="2">
             <apex:pageBlockSectionItem >
                 <apex:outputLabel value="Select an object::"></apex:outputLabel>
                 <apex:selectList value="{!objectName}" size="1" multiselect="false">
                     <apex:selectOptions value="{!selectedobject}">
                       <apex:actionSupport action="{!function}" event="onchange" reRender="theForm"/>  
                     </apex:selectOptions>
                 </apex:selectList>
             </apex:pageBlockSectionItem>
             <apex:pageBlockSectionItem >
                 <apex:outputLabel value="Select Fields:"> </apex:outputLabel>
                 <apex:selectList value="{!fields}" multiselect="true" size="3" disabled="{!if(selectfields.size==1,true,false)}">
                     <apex:selectOptions value="{!selectfields}">
                     
                     </apex:selectOptions>
                 </apex:selectList>
             </apex:pageBlockSectionItem>
         </apex:pageBlockSection>
     </apex:pageBlock>
 </apex:form>
</apex:page>

  • February 11, 2013
  • Like
  • 0

Hi

    We have a doubt that ,after compleating of Approval process  an invoice must generated in the form of pdf and this pdf is to be inserted in Notes and attachments.

 

Is it possible by standard functionality or by custom logic.

  • February 07, 2013
  • Like
  • 0

Hi

    We have a doubt that ,after compleating of Approval process  an invoice must generated in the form of pdf and this pdf is to be inserted in Notes and attachments.

 

Is it possible by standard functionality or by custom logic.

  • February 07, 2013
  • Like
  • 0

Hi,

 

i wrote the test class for some class,in that ...i don't know how to pass the recordtypes and it's i.d's for particular data...so,could you guys....help me on test class for record type i.d's...

  • August 08, 2012
  • Like
  • 0

Hi

    We have a doubt that ,after compleating of Approval process  an invoice must generated in the form of pdf and this pdf is to be inserted in Notes and attachments.

 

Is it possible by standard functionality or by custom logic.

  • February 07, 2013
  • Like
  • 0

Hi,

 

i wrote the test class for some class,in that ...i don't know how to pass the recordtypes and it's i.d's for particular data...so,could you guys....help me on test class for record type i.d's...

  • August 08, 2012
  • Like
  • 0