Skip to main content
added 298 characters in body
Source Link
shai
  • 43
  • 3

I am using the C# web-service to get data from salesforce,

After calling the "sforceService.describeSObjects()" function, I am running on the object and get they ChildRelationships.

For example, I try to get the relationship between Account<--->AccountShares

The values in the object are: currentSObject.name ="Account" (This is the foreignPrimary table) relationship.relationshipName ="Shares"
relationship.childSObject = "AccountShare" (This is the Primaryforeign Table) relationship.field = "AccountId" (This is the Primaryforeign Key on AccountShare)

My Question is, from where if get the ForeginKeyPrimary Key column in the Account table?, there is no column "Shares" in Account table, so the relationship.relationshipName is not the Foreign keyPrimary Key (I try to build a basic 1:Many relationship).

Thanks for the help!

Update: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_majors.htm

From this ERD, I understand that almost every table have "Id" column that is the PrimaryKey on that table, but that's not right for all the tables (for example Contract table dosent have Id column)

I am using the C# web-service to get data from salesforce,

After calling the "sforceService.describeSObjects()" function, I am running on the object and get they ChildRelationships.

For example, I try to get the relationship between Account<--->AccountShares

The values in the object are: currentSObject.name ="Account" (This is the foreign table) relationship.relationshipName ="Shares"
relationship.childSObject = "AccountShare" (This is the Primary Table) relationship.field = "AccountId" (This is the Primary Key on AccountShare)

My Question is, from where if get the ForeginKey column in the Account table?, there is no column "Shares" in Account table, so the relationship.relationshipName is not the Foreign key (I try to build a basic 1:Many relationship).

Thanks for the help!

I am using the C# web-service to get data from salesforce,

After calling the "sforceService.describeSObjects()" function, I am running on the object and get they ChildRelationships.

For example, I try to get the relationship between Account<--->AccountShares

The values in the object are: currentSObject.name ="Account" (This is the Primary table) relationship.relationshipName ="Shares"
relationship.childSObject = "AccountShare" (This is the foreign Table) relationship.field = "AccountId" (This is the foreign Key on AccountShare)

My Question is, from where if get the Primary Key column in the Account table?, there is no column "Shares" in Account table, so the relationship.relationshipName is not the Primary Key (I try to build a basic 1:Many relationship).

Thanks for the help!

Update: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_majors.htm

From this ERD, I understand that almost every table have "Id" column that is the PrimaryKey on that table, but that's not right for all the tables (for example Contract table dosent have Id column)

Source Link
shai
  • 43
  • 3

Understanding ChildRelationship object

I am using the C# web-service to get data from salesforce,

After calling the "sforceService.describeSObjects()" function, I am running on the object and get they ChildRelationships.

For example, I try to get the relationship between Account<--->AccountShares

The values in the object are: currentSObject.name ="Account" (This is the foreign table) relationship.relationshipName ="Shares"
relationship.childSObject = "AccountShare" (This is the Primary Table) relationship.field = "AccountId" (This is the Primary Key on AccountShare)

My Question is, from where if get the ForeginKey column in the Account table?, there is no column "Shares" in Account table, so the relationship.relationshipName is not the Foreign key (I try to build a basic 1:Many relationship).

Thanks for the help!