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
GeetuGeetu 

I have a junction object C with A and B as master detail relationship. We have a trigger to insert record into C object when ever a record is inserted into B for A records.

Hi All, 

Need a help 

I have  a junction object C with A and B as master detail relationship. We have a trigger to insert record into C object when ever a record is inserted into B for A records.
My requiement is to copy a value(city from B object) from B object to C object . And then i am using this city for some conditional logic.  I need help in designing this, i can create a new field at C object(CITY) and then i can copy the value from B to C in existing trigger. But when i need to use this City field in conditional logic on A object, how do i do this. Hope i have complicated my requirement.

thansk in advance. 
Best Answer chosen by Geetu
Sudhir gonuguntlaSudhir gonuguntla
Keep the below result in list and use City__c in conditional logic 
 
Select Id, Name, city__c , Relationship__c from Object C where Relationship__c  IN (Select id from Object A)

 

All Answers

Sudhir gonuguntlaSudhir gonuguntla
Keep the below result in list and use City__c in conditional logic 
 
Select Id, Name, city__c , Relationship__c from Object C where Relationship__c  IN (Select id from Object A)

 
This was selected as the best answer
GeetuGeetu
Thanks Sudhir.