Grandchild BO does not get foreign key value from Parent Insert


Author
Message
Leonard P.
Leonard P.
StrataFrame Novice (93 reputation)StrataFrame Novice (93 reputation)StrataFrame Novice (93 reputation)StrataFrame Novice (93 reputation)StrataFrame Novice (93 reputation)StrataFrame Novice (93 reputation)StrataFrame Novice (93 reputation)StrataFrame Novice (93 reputation)StrataFrame Novice (93 reputation)
Group: Awaiting Activation
Posts: 65, Visits: 306
Hello,



I have a situation where I need to insert new rows of 3 related BOs on .Save. BOs parent/child relationship is setup correctly in the BO Mapper, and it follows the following path:



BO_1

P1_Key (PK)



BO_2 (Child to BO_1)

P2_Key (PK)

P1_Key (FK to BO_1)



BO_3 (Child to BO_2)

P3_Key (PK)

P1_Key (FK to BO_2)

P2_Key (FK to BO_2)



When I call Save to add new rows of all 3 BOs, the first 2 inserts complete successfully, but BO_3 insert fails, because it doesn't get newly inserted P1_Key. I realize that the design could be improved by simply getting rid of P1_Key FK in BO_3, but lets say for now that I need to stick to this design to accommodate some obscure requirements.

So, why doesn't BO_3 get P1_Key?



Thanks



Reply
Charles R Hankey
Charles R Hankey
StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)StrataFrame VIP (1.3K reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I'm sure you'll get replies with a lot more SF knowledge than mine, but my first reaction would be I wouldn't expect bo3 to get the pk from bo1 automatically, since the parentchild relationship is only between bo2 and bo3. If you are getting bo2's pk as an fk in bo3 I'd say everything is working as designed. You might want to grab the bo1fk from bo2 on the save of bo3, but I dont think the framework is going to give you two fks.



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search