You need to sign in to do that
Don't have an account?
kanupriya sharma
foreignKeys salesforce
I need to get the foreign key columns of a table . In the describeObjectResult for the table,I get a list of child relationships but not the fk columns in this table to which the child column is mapped.
Every object have an ID field that is a primary key,
If you will create lookup or master-detail detail relationship on child object that will be Foreign key
Let me know if this will help you
Can you please try using below method:
getChildRelationships()
Returns a list of child relationships, which are the names of the sObjects that have a foreign key to the sObject being described.
Regards,
Amol
http://salesforce-walker.blogspot.com/2012/12/getting-child-relationshipnames-using.html
Thanks for the reply but what I actually meant was that I have the list of childRelationships and also the chid fields which are the referenced columns for the describe object , but what I need to know is the foreing Key column in this decribed object .So for eg , if I describe Account ,I get a list of childRealtionsips and suppose COntact is a childObject for Account and getField which is the referenced column . but which column in Account is this column in Contact mapped to ?