• Ketan Benegal 7
  • NEWBIE
  • 5 Points
  • Member since 2016

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

i got an error like "Method does not exist or incorrect signature: [Schema.ChildRelationship].getChildObject()"" in 14th line of the program


public class SchemaFieldExample {
list<selectoption> options;
  public list<selectoption>getoptions()
    {
        return options;
    }
    public SchemaFieldExample()
    {
        options=new list<selectoption>();
        schema.DescribeSObjectResult r=Account.SobjectType.getDescribe();
        list<schema.ChildRelationship> c=r.getChildRelationships();
        for(schema.ChildRelationship x:c)
        {
            String name=''+x.getChildObject();
            selectoption op=new selectoption(name,name);
            options.add(op);
        }
    }
    
}
Hi there,

Can we use a SWITCH control statement in the APEX class? Is it possible and supported by APEX?

thanks