trap it at the form level?

for each field in form
  if (user_existing[field] NEQ form[field])
    // different so add to the email
  end if
next field

just a thought...

On 5/23/06, Mike Kear <[EMAIL PROTECTED]> wrote:

I have a user profile module that I'm working on, that has a LOT of fields
in various tables - memberdetails, addresses, positions, educationlevels,
specialinterestgroups, etc etc and I want the members to be able to maintain
their own member profile on line.  I have beans and DAO cfcs to handle all
the parameters.  So far so good.

But the administration office hasn't yet changed their system to use the
online database for membership records, so I need to send them an email
advising them that a member has changed their profile.   They can manually
change their records to keep them in synch with the online records.

But if i sent an email saying "member X changed his profile and here's the
new record ...."  they'll get a long page of data and have to wade through
field by field looking for what's changed.   What would be far better if i
can tell them what's changed.    There's my problem.  How to identify the
fields that have changed?

Here's how i thought I'd do it, but is there an easier way?

I thought I'd create two identical user beans - User.cfc and
user_existing.cfc,  collect the new values from the online form in user.cfc
   then at the time of preparing the email,  go through all the fields
comparing the two values, and put anything that doesnt match in red bold or
something, using something like this:

<cfif user.getname() NEQ
user_existing.getname()><span.style="color:red;font-weight:700;">#user.getname()#</span><cfelse>#user.getname()#</cfif>

but that looks like an AWFUL lot of code for a hundred fields or so.    Is
there an easier way to do it?

--
Cheers
Mike Kear
Windsor, NSW, Australia
Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month
----------------------------------------------------------
 You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.

 CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

 An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to