You need to sign in to do that
Don't have an account?

Trying to map in memory
Hi,
I have an two objects Object A and Object B.
I created a map between Object A and Object B so that the Id of Object A is assigned to ParentId of Object B.
Object B.ParentId= Object A.Id - this is the goal. Assignment should happen in Map itself even before insert happens.
Steps:
Created a Map which links both objects.
insert Object A;
insert Object B;
Id in Object A gets generated only after it is inserted in the db. When I do this ParentId value is still displayed as null. So basically it is not getting Object A' Id value.
Can somebody help me soon?
I have an two objects Object A and Object B.
I created a map between Object A and Object B so that the Id of Object A is assigned to ParentId of Object B.
Object B.ParentId= Object A.Id - this is the goal. Assignment should happen in Map itself even before insert happens.
Steps:
Created a Map which links both objects.
insert Object A;
insert Object B;
Id in Object A gets generated only after it is inserted in the db. When I do this ParentId value is still displayed as null. So basically it is not getting Object A' Id value.
Can somebody help me soon?
You can't update object a, but you can create object b and use object a's Id.