I used CFBuilder "create CFC" plugin to create a services for a table, so i could play around with OOD. Now I am struggling to use the "update" function generated in a dynamic manner.
I call a cfc, to get the structure of the account, passing an ID.
<cfinvoke component="cfc.Account.accountService" method="getAccount" returnvariable="Account" AccountID="#session.auth.AccountID#">
I could call the update function using a manual bit of code.
<cfset Account.setAccountFirstname('#form.AccountFirstname#')>
That works fine, but I want to dynamically update the structure based on data from a form. So I figured loop the fields in the form and produce the following
<!--- Dynanic call of submitted fields --->
<cfloop list="#form.FieldNames#" index="i">
<cfset Account.set[i]('#Evaluate('#i#')#')>
</cfloop>
Now of course that does not work! any ideas what would work? Or a better way to handle it?