Forum Replies Created

  • Hi Mohit,

    One liner answer to this question can be by using below line we can get object name based on parent id :
    List<Schema.ChildRelationship> lstCR = <parentID>.getSObjectType().getDescribe().getChildRelationships() ;

    Below is the detailed example to get child object names (list of string) by parent ID :

    ID idToGet = '<Any Parent Object ID>';
    List<string> lstChildObj = GetChildObjects(idToGet);
    System.debug(lstChildObj);

    // Below function accepts 18 digit parent ID and returns list of Child Object 's API name.
    public List<String> GetChildObjects(ID parentID)
    {
    List<string> lstChildObjects = new List<string>();
    Schema.DescribeSObjectResult parentDescribeResult = r
    String sObjName = parentDescribeResult.getName();
    System.Debug('Parent object name : ' + sObjName);
    for (Schema.ChildRelationship childRel: parentDescribeResult.getChildRelationships())
    {
    lstChildObjects.add(childRel.getChildSObject().getDescribe().getName());
    }
    return lstChildObjects;
    }

    Thanks,

    Extentia

  • Salesforce Lightning Design System (LDS) and Bootstrap are both UI frameworks but are used for different purposes. With the Lightning Design System, you can build custom applications with a look and feel that is consistent with the core features of Salesforce; whereas Bootstrap can be used to develop attractive/custom branded UI and includes its own JavaScript framework. LDS is a pure CSS framework.

Popular Salesforce Blogs

Popular Salesforce Videos