<cfset prvInv.setAmount(0)>
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.
TeddyOn 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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
