function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sdfc devSdfc dev 

Translated related list label using apex

Hi

 

I overrode a  related list label using translation workbench. How do i get the translated related list label using apex? 

 

I tried with Schema.getChildRelationships but no luck.

 

Thanks in advance.

souvik9086souvik9086

You can do like this

 

Schema.DescribeSObjectResult descForSelObj = Schema.getGlobalDescribe().get(objectName).getDescribe();
List<Schema.ChildRelationship> childObjects = descForSelObj.getChildRelationships();

 

for(Schema.ChildRelationship childObj : childObjects) {

 

System.debug('======='+childObj.getRelationshipName());

}

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

Sdfc devSdfc dev

Hi Souvik,

 

Thanks for your reply.

 

I think you misunderstood my usecase, I am trying to get the translated related list LABEL in apex instead of relationship API name.

 

Thanks,