You need to sign in to do that
Don't have an account?

How to get SObject Name of Master-Detail Field?
I develop Apex Code, is Create Field.
That made by Metadata API..
A Object and B Object must have Only one master-detail Field, right?
I created Master(A)-Detail(B) Field in B Object. and
When I create Master-Detail Field, I want know Master-detail Field related to A Object.
How to get Master SObject Name of Master-Detail Field?
I was execute code.
But I can't find Object A Name....
That made by Metadata API..
A Object and B Object must have Only one master-detail Field, right?
I created Master(A)-Detail(B) Field in B Object. and
When I create Master-Detail Field, I want know Master-detail Field related to A Object.
How to get Master SObject Name of Master-Detail Field?
Map<String, Schema.SObjectField> fieldMap = Schema.getGlobalDescribe().get('B__c').getDescribe().fields.getMap(); for(Schema.SObjectField f : fieldMap.values()) { System.debug(f.getDescribe()); }
I was execute code.
But I can't find Object A Name....
All Answers
Thank you very much!
That is perfect Answer, Best of Best!
Below Code can fulfill your requirements. Hope this will work for you.
Please mark this as best answer if this solves your problem.
Thank you,
Ajay Dubedi