New Posts New Posts RSS Feed: Reference lists in sandboxed entity manager
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Reference lists in sandboxed entity manager

 Post Reply Post Reply
Author
hueha View Drop Down
Newbie
Newbie


Joined: 23-Jul-2010
Posts: 38
Post Options Post Options   Quote hueha Quote  Post ReplyReply Direct Link To This Post Topic: Reference lists in sandboxed entity manager
    Posted: 23-Jan-2011 at 3:03am
I'm trying to sandbox my editing but I'm across a problem.  If I try and assign an entity to the property of another entity I get the following error

Cannot assign entities from one entity manager to another unless the entity on one side or the other is detached.

I've managed to get around it for some static reference data by assigning it via primary keys rather than the related object.  But how should this work for many to many relationships.  

Another scenario.
Lets say I have a parent child relation e.g. "invoice" and "invoice detail" and invoice detail have an"item" property.  If I sandboxed the invoice edit and then sandboxed the invoice detail edit would I end up with 3 versions of the "item" entity (1 in the main EM, one in the invoice sandbox and one in the invoice detail sandbox) in memory, is there a better way to handle this?  

Or is the recommended way to sandbox the invoice from the main em and the invoice detail from the main em also instead of importing from the invoice sandbox, which would avoid the need for the invoice sandbox to contain the items for the invoice detail sandbox.  If this is the better way how to I reflect the changes from the invoice detail sandbox in the invoice when the invoice detail sandbox closes.


Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post Posted: 23-Jan-2011 at 11:13am
You have to import any entities you want to use into the new entity manager.

Rather than sandboxing Invoices and Invoice Details individually, I would sandbox the entire Invoice/Invoice Detail area. So that if you have multiple invoices open, they are in different managers, but each invoice and it's child details are together.




Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down