Information générale
Catégorie:
The Mere Mortals Framework
>>>>Kevin,
>>>>
>>>>When using an Event object, I need to include two business objects that are related to each other (ie in a One to Many relation). Is there any way to do this short of adding these objects to the form and overriding the DefineParticipatingEntities method?
>>>>
>>>>TIA
>>>>
>>>>Rex
>>>
>>> PMFJI - There shouldn't be any reason you need to add the objects to the form. You can just define them in the DefineParticipatingEntities() method of your event and it will automatically instanciate them for you. Once it's done they'll disappear.
>>>
>>>-Paul
>>
>>Paul,
>>
>>What about relating business objects to each other and to existing objects?
>>I'm not sure it is possible in code.
>>
>>What do you think?
>>
>>Rex
>
> Ah. I see what you're trying to do. I assumed you had already set-up the relation in the class before instancing it. I haven't tried that but couldn't you pass the "parent" bizobj first in DefineParticipatingEntities() then your child object, then in the ExecuteEvent() method place the reference to the parent object in the child. The code would look something like:
>
>DefineParticipatingEntities()
>------------------------------
>This.Add("Project", "ProjectsObj") && Parent
>This.Add("Staff", "StaffObj") && Child
>
>
>ExecuteEvent()
>------------------------------
>LOCAL loProject, loStaff
>
>loProject = THIS.Get("Project")
>loStaff = THIS.Get("Staff")
>
>loStaff.cParentBizObj = "Project"
>
>* Set any other parent/child properties like lNewChildOnNewParent, etc.
>
>* Continue on with the rest of the processing
>
>
>
> Maybe Kevin will jump in and clear this up.
Paul,
I don't think so. I think the cParent needs to be set before instantiation since there are linking properties for each bizobj.
Hope I hear from Kevin soon.
Thanks
Rex
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement