Hi.

After some investigation a found a couple of things I was doing wrong. When trying to do a save(), I was not doing a <cfset UserInfoRecord = UserRecord.gettblUserInfo () /> before I did the UserRecord.load(). That allowed me to save existing records to both tables by executing a UserRecord.save(). However, if this is a new record, it will save to both tables, but will not put the correct userid in the UserInfo table.

byron

Byron Raines wrote:
Dan,

Yes. Each table has "UserID" as the primary key. In the table 'tblUser', I have it as an indentity key. In 'tblUserInfo', it is not.

byron

Dan Wilson wrote:
Byron,

You brought up primary keys,,, are your two tables related by key in
the database?  Do you have primary keys on each table?

dw

On 9/29/06, Dan Vega <[EMAIL PROTECTED]> wrote:
What is not working? Please be a little bit more specfic as to what is going
wrong.


On 9/29/06, Byron Raines <[EMAIL PROTECTED] > wrote:
> Nope.  That does not seem to do it.
>
> byron
>
> Dan Vega wrote:
> > I am pretty sure that you still have to make the call. I could be
> > wrong though.
> >
> > <cfset UserRecord = Reactor.createRecord("tblUser") />
> > <cfset UserInfoRecord = UserRecord.gettblUserInfo () />
> >
> > <cfset UserRecord.setUsername("bobo") />
> > <cfset UserInfoRecord.setFirstname("bobo") />
> > <cfset UserInfoRecord.setMI("the") />
> > <cfset UserInfoRecord.setLastname ("clown") />
> >
> > <cfset USerRecord.save() />
> > <cfset UserInfo.save()/>
> >
> > On 9/29/06, *Byron Raines* < [EMAIL PROTECTED]
> > <mailto:[EMAIL PROTECTED]>> wrote:
> >
> >     Hi all I have the following:
> >
> >     In reactor.xml :
> >
> >             <object name="tblUser">
> >                 <hasOne name="tblUserInfo">
> >                     <relate from="UserID" to="UserID" />
> >                 </hasOne>
> >             </object>
> >
> >     I do the following to create a new record:
> >
> >     <cfset UserRecord = Reactor.createRecord("tblUser") />
> >     <cfset UserInfoRecord = UserRecord.gettblUserInfo() />
> >
> >     <cfset UserRecord.setUsername("bobo") />
> >     <cfset UserInfoRecord.setFirstname("bobo") />
> >     <cfset UserInfoRecord.setMI("the") />
> >     <cfset UserInfoRecord.setLastname ("clown") />
> >
> >     <cfset USerRecord.save() />
> >
> > What happens is that the record is inserted into "tblUser", but not
in
> > "tblUserInfo". Not sure what I'm missing here. Does it have to do
> >     something with the primary key?
> >
> >     Thanks
> >
> >     byron
> >
> >
> >
> >
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >     -- -- -- -- --
> >     Reactor for ColdFusion Mailing List
> >     [email protected] <mailto:[email protected]>
> >     Archives at:
http://www.mail-archive.com/reactor%40doughughes.net/
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >     -- -- -- -- --
> >
> >
> >
> >
> > --
> > Dan Vega
> > [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > -- -- -- --
> > Reactor for ColdFusion Mailing List
> > [email protected]
> > Archives at:
http://www.mail-archive.com/reactor%40doughughes.net/
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > -- -- -- --
>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
> Reactor for ColdFusion Mailing List
> [email protected]
> Archives at:
http://www.mail-archive.com/reactor%40doughughes.net/
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
>
>



--
Dan Vega
[EMAIL PROTECTED]
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at:
http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --




-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to