Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-24 Thread Johan Henselmans
On Apr 17, 2012, at 7:25 PM, Pascal Robert wrote: Le 2012-04-17 à 13:18, Ramsey Gurley a écrit : Agreed. I like George's original suggestion. In the migration that creates the required contract relationship, go through all the existing Shows and create a default contract there. Keep

Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-17 Thread Johan Henselmans
On Apr 16, 2012, at 6:16 PM, Ramsey Gurley wrote: On Apr 16, 2012, at 9:13 AM, Johann Werner wrote: Am 16.04.2012 um 16:43 schrieb Johan Henselmans: On Apr 14, 2012, at 10:20 PM, Johan Henselmans wrote: On Apr 14, 2012, at 4:17 PM, George Domurot wrote: In your code snip,

Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-17 Thread Kieran Kelleher
Try refaulting the Show after you create the Contract to see if that helps. ec.refaultObject(...) On Apr 17, 2012, at 5:40 AM, Johan Henselmans wrote: On Apr 16, 2012, at 6:16 PM, Ramsey Gurley wrote: On Apr 16, 2012, at 9:13 AM, Johann Werner wrote: Am 16.04.2012 um 16:43 schrieb

Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-17 Thread Chuck Hill
Doing all this in awakeFromFetch makes me feel kind of nervous. Chuck On 2012-04-17, at 9:41 AM, Kieran Kelleher wrote: Try refaulting the Show after you create the Contract to see if that helps. ec.refaultObject(...) On Apr 17, 2012, at 5:40 AM, Johan Henselmans wrote: On Apr 16,

Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-17 Thread Kieran Kelleher
I feel the same . but he can try it, test it and see what happens I guess. If it was me, I would have just written a script to migrate the database and be done with it. On Apr 17, 2012, at 12:45 PM, Chuck Hill wrote: Doing all this in awakeFromFetch makes me feel kind of nervous.

Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-17 Thread Ramsey Gurley
Agreed. I like George's original suggestion. In the migration that creates the required contract relationship, go through all the existing Shows and create a default contract there. Keep the data clean. Don't use awakeFromFetch for tricks like this. Think about it... What if the company hires

Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-17 Thread Pascal Robert
Le 2012-04-17 à 13:18, Ramsey Gurley a écrit : Agreed. I like George's original suggestion. In the migration that creates the required contract relationship, go through all the existing Shows and create a default contract there. Keep the data clean. Don't use awakeFromFetch for tricks

Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-16 Thread Johan Henselmans
On Apr 14, 2012, at 10:20 PM, Johan Henselmans wrote: On Apr 14, 2012, at 4:17 PM, George Domurot wrote: In your code snip, you aren't adding the newContract object into the editing context. To reduce errors like these, always use: Thanks, after I posted the code I noticed that

Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-16 Thread Johann Werner
Am 16.04.2012 um 16:43 schrieb Johan Henselmans: On Apr 14, 2012, at 10:20 PM, Johan Henselmans wrote: On Apr 14, 2012, at 4:17 PM, George Domurot wrote: In your code snip, you aren't adding the newContract object into the editing context. To reduce errors like these, always use:

Re: Inserting a new obligatory entity in an relation, where? (SOLVED?)

2012-04-16 Thread Ramsey Gurley
On Apr 16, 2012, at 9:13 AM, Johann Werner wrote: Am 16.04.2012 um 16:43 schrieb Johan Henselmans: On Apr 14, 2012, at 10:20 PM, Johan Henselmans wrote: On Apr 14, 2012, at 4:17 PM, George Domurot wrote: In your code snip, you aren't adding the newContract object into the

Re: Inserting a new obligatory entity in an relation, where?

2012-04-14 Thread George Domurot
In your code snip, you aren't adding the newContract object into the editing context. To reduce errors like these, always use: ERXEOControlUtilities.createAndInsertObject I'd recommend not doing this in awakeFromFetch, but making this a step in your migration to clean-up your DB/object graph.

Re: Inserting a new obligatory entity in an relation, where?

2012-04-14 Thread Johan Henselmans
On Apr 14, 2012, at 4:17 PM, George Domurot wrote: In your code snip, you aren't adding the newContract object into the editing context. To reduce errors like these, always use: Thanks, after I posted the code I noticed that error and added eo,insert(newContract) It still does not want