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
stefhstefh 

Topic / Topic Assignment Relationship Problem

i'm trying to get query the relationship between topics and their assignments, but sf doesn't seem to be recognising the relationship between the two.

 

topics have a many to many relationship with feeditems, through a link table object, topicassignment.

 

on workbench, it clearly shows a parent:child (one to many) relationship from topics to topic assignments via the topicid key; AND a similar relationship from feeditems to topicassignments, though the entryid key.

 

however, i don't seem to be able to get any of these relationships (the many to many relationship of topics to feeditems, or the implied one to many relationships of topic to assignment and feeditem to assignment)

 

the following queries:

  • SELECT id, name, (SELECT id FROM TopicAssignments) FROM topic
  • SELECT id, (SELECT id FROM TopicAssignments) FROM feeditem
  • SELECT id, name, (SELECT id FROM entries) FROM topic
  • SELECT id, name, (SELECT id FROM feeditems) FROM topic
  • SELECT id, name, entry.id FROM topicassignment
  • SELECT id, name, topic.id FROM topicassignment

all result in "Didn't understand relationship"

 

any help would be greatly appreciated.

 

TheDoctorTheDoctor

Sorry if this seems like a stupid question, but you are remembering to use __c and __r where appropriate right?

Rahul_sgRahul_sg
use
SELECT Id, TopicId FROM TopicAssignment
SELECT Id, entityId FROM TopicAssignment

there is no column " name " in TopicAssignment.
also, you can use developer console for finding api names of the fields
Rajendra KumawatRajendra Kumawat
@Rahul_sg
Its working to fetch the id.
And my requirment is to fetch all topics fields and its content by ussing sope api and update its fields content and post to upload images.
So please help me to solve out the problems.
Am still waiting for your help.

Thanks Rahul_sg