Setting in the transfer object will work.

But if you set a default value for that column in the database then reactor should be able to find that value and set it as the default in the transfer object automatically.

Clayton

On 14-Sep-06, at 3:03 PM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:

That way works also, but then I’d have to do it everytime I make a new invoice.

That’s why I’m going to go with

 

<cfset this.amount = 0> in my transfer object.

 

Thanks!

Nate

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Teddy Payne
Sent: Thursday, September 14, 2006 12:01 PM
To: [email protected]
Subject: Re: [Reactor for CF] Default value for a column

 

<cfset prevInv = application.ReactorFactory.createRecord("INVOICE")>
<cfset prvInv.setAmount(0)>

On 9/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

I am creating a record for the invoice and want it to have several fields have 0 as the default.

I'm doing a:

<cfset prevInv = application.ReactorFactory.createRecord("INVOICE")>

 

And in the TO for invoice I have:


<cfcomponent extends="reactor.project..To.INVOICETo">
       <!--- Place custom code here, it will not be overwritten --->
       <cfset Amount = 0 />
</cfcomponent>

But after I dump the prevInv I just created by doing:

<cfdump var="#PrevInv._getTo()#">

 

It is blank.   How can I have amount default to 0 when I create a new record?

 


From: [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED]] On Behalf Of Teddy Payne
Sent: Thursday, September 14, 2006 11:37 AM
To: [email protected]
Subject: Re: [Reactor for CF] Default value for a column

 

If you are creating a new record, you can just call the setter method for that column for the record.

Teddy

On 9/14/06, Mr. Darby < [EMAIL PROTECTED]> wrote:

Nate,

Try using your extended TO object for the table.  It will get hit before the record and will load your record with your parameters.  The TO is basically a structure of your table column values that the record used to populate it self.

in the custom TO you would do this
<cfcomponent extends="reactor.project..To.INVOICETo">
       <!--- Place custom code here, it will not be overwritten --->
       <cfset Amount = 0 />
</cfcomponent>

And it should set the default values you need.

 

On 9/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Where do I set a default value for a record?

I have an invoice record and I want to set the amount to default to 0.
So in my invoiceRecord in my model/reactor files I did a:

<cfcomponent extends=" reactor.project..To.INVOICERecord">
        <!--- Place custom code here, it will not be overwritten --->
        <cfset this.setAmount(0)>
</cfcomponent>

And it errors:

The method 'setAMOUNT' could not be found in component
/oceans6/opt/var/www/mainweb/Applications/319G/budgetVoucher/model/react
or/Record/INVOICERecord.cfc.


What am I doing wrong?

Thanks,
Nate


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --




--
<cf_payne />

Blog: http://cfpayne.wordpress.com/
Atlanta CFUG: http://www.acfug.org
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --




--
<cf_payne />

Blog: http://cfpayne.wordpress.com/
Atlanta CFUG: http://www.acfug.org
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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