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
SFDC New learnerSFDC New learner 

How to populate the Id in child object after insert

Hi All,

I have an object with a start date and an end date. I am trying to create insert weekly dates in one object and a list of dates between the start date and end date in another object.
Object A
start Date    End Date
10/01/2020  10/31/2020
Object B
start date      end date          Object A ID
10/01/2020     10/07/2020
10/07/2020     10/14/2020
10/14/2020     10/21/2020
10/21/2020     10/27/2020
10/27/2020       11/03/2020

Object C
Date              Object BID   Object A ID
10/01/2020
10/02/2020
10/03/2020
---
--
10/31/2020

I have created lookup from Object B to Object A and Object C to Object B and Object C to Object B.
Is it possible to map Object B and Object C. How can I populate Object B Id in Object C? Can anyone send a sample code?

Thanks,
Sirisha
Deepak GerianiDeepak Geriani

Hello,

You can refer to the below link it might help you.

https://help.salesforce.com/articleView?id=relationships_manytomany.htm&type=5 (https://help.salesforce.com/articleView?id=relationships_manytomany.htm&type=5)

Please let me know if you need any help

if your issue is resolved please mark it as solved.

SFDC New learnerSFDC New learner
@Deepak Geriani, the issue is resolved.