Just to let you know I did manage to figure it out.

Sometimes persistance is all you need.
this seemed to work fine:

<cfset var.arg_value =
evaluate("createProductArray[#var.i#].#var.fieldName#")>
<cfset var.thisObject = var.productArray[var.i]>
<cfset temp =
evaluate("var.thisObject.set#var.fieldName#('#var.arg_value#')")>

Thanks for looking

-Joshua O'Connor-Rose
-All is Good

--- Joshua OConnor-Rose <[EMAIL PROTECTED]> wrote:

> Ok so things are moving along here with the
> salesforce
> api, mixing a significant amount of Java with the
> CFC
> and we are making some real progress.
>
> So thanks to Spike and Sean and Sam and Guy. A
> bunch.
>
> So I have a new question.
>
> I have a java object instatiated through ColdFusion
> that has methods based on the table that it updates.
>
> Like if the table has fields Name, ID, ProductCode
>
> then the object has methods setName(), setID(),
> setProductCode().
>
> what I'm trying to do is call these methods
> dynamicly
> based on the fields that exist in the "table".
>
> heres some code
>
> <cfset var.field_list =
> this.getSObjectFields("Product2")>
> <cfset var.productArray = arrayNew(1)>
> <cfloop index="var.i" from="1"
> to="#arrayLen(createProductArray)#">
> <cfset var.productArray[var.i] =
>
this.loader.loadClass("com.sforce.soap.enterprise.sobject.Product2").newInstance()>
> <cfloop list="#var.field_list#"
> index="var.fieldName">
> <cfif
>
structKeyExists(createProductArray[var.i],"#var.fieldName#")>
> <cfset var.arg_value =
>
evaluate("createProductArray[#var.i#].#var.fieldName#")>
> <!---
> Some things already tried:
> (I don't know why I keep trying this one)
> <cfset var.productArray[#var.i#].#var.fieldName#
> =
> var.arg_value>
> (if I could invoke the method using cfinvoke
>      that would be cool but it's a java object)
> <cfinvoke
> component="var.productArray[#var.i#]"
> method="set#var.fieldName#">
> <cfinvokeargument name="#var.fieldName#"
> value="#var.arg_value#">
> </cfinvoke>
> --->
> </cfif>
> </cfloop>
> </cfloop>
>
> -Joshua O'Connor-Rose
> -All is Good
>
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to