Chris,

I set it in the record.cfc like so:

 <cffunction name="save" access="public" returntype="void" output="false"  >
    <!--- @@Note: reactor's iterator calls this save w/o named parameters. ZThis will cause problems unless useTransation is first" --->
        <cfargument name="useTransaction"    type="BOOLEAN" hint="I indicate whether the save should be wrapped in a cftransaction" />
        <cfargument name="user_id"            type="string" default="Default User" hint="I contain the user_id of the logged on user " />
        <cfscript>
            var local = structNew();
            setUpdate_user (arguments.user_id);
            setdate_Updated ( now() );
          
           if (getID() is 0) {
                setCreate_user ( arguments.user_id);
               setdate_Created ( now());
            }
       return super.save( argumentCollection=arguments );
        </cfscript>
    </cffunction>

</cfcomponent>

On 9/1/06, Chris Blackwell <[EMAIL PROTECTED]> wrote:
My Client object has a createdByUserID field, which should be set to the
id of the user that created it.  I could just stick <cfset
this.createdbyuserid = session.user.getUserId()> in the ClientTO.cfc but
this just seems bad.

I'd like to set this in one place, so how should I go about setting this
without littering my code with calls to setCreatedByUserId()?

I'm not using a framework, but could coldspring help with this?

Cheers,
Chris





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