Iam creating dummy records for Topic and its assignment.Topic is creating successfully Topic assignment shows error
Failed to assign topic to null. Please ensure you have permissions to assign topics for this record.
I have checked profile level,assign topic is enabled whats the issue here.
Topic newTopic = new Topic(Name='newArticleTopic', NetworkId='0DB24000000TNlXGAW'); insert newTopic; system.debug('newTopic@@'+newTopic.Id); Topic newTopic2 = [select Id from Topic where Id=:newTopic.Id]; system.debug('****'+newTopic2.Id); TopicAssignment newTopicAssignment = new TopicAssignment(TopicId=newTopic2.Id, NetworkId='0DB24000000TNlXGAW'); insert newTopicAssignment;