Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8753381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:24:51+00:00 2026-06-13T13:24:51+00:00

I used CFBuilder create CFC plugin to create a services for a table, so

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:24:53+00:00Added an answer on June 13, 2026 at 1:24 pm

    What you are trying to do with invoke wont work, this is because you are passing the attribute as a standalone component argument (I.e the class path) you need to pass in the object instance instead.

    Edit to add:

    <cfset account = new Account()/>
    <cfset data = {
      accountId = session.auth.AccountID
    }/>
    <cfset fieldNames = listToArray(form.fieldNames)/>
    <cfif ! arrayIsEmpty(fieldNames)>
      <cfloop array="#fieldNames#" index="fieldName">
        <cfinvoke 
          component="#account#"
          method="set#FieldName#" 
          returnVariable="methodResult" 
          argumentCollection="#data#"
        />
      </cfloop>
    </cfif>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used the phonegap website to create an IPA file. Now I want to
I used to use XCode the develop my apps and using that; I could
Used code I found on SO to use the COM based Acrobat Reader to
Having used storyboards for a while now I have found them extremely useful however,
I used TOAD for oracle 11g, I want to create an insert script from
Used the create unit tests tool in Visual Studio and obviously it tries to
Used to run R with numbers and matrix, when it comes to play with
I used to export blender models to use them in with three.js. That was
I used Attach method to update my Database name=New Name; checkBox1=false; Entity entity= new
I used to use the anonymous self-execute function in js: ((function(){ //do something })();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.