Try initialising sailsprops:
<cfset sailsprops = structnew() />
before setting the properties and saving.

createData is probably adding properties that you need to clear out.

Blair

On Tue, Apr 14, 2009 at 10:41 AM, Marco van den Oever <
[email protected]> wrote:

>
> I have an array with shop items, the cfdump is:
>
> -------
>
> 1
>
> AMOUNT  1
> ID      8FD457C0-2399-11DE-98AA000C7674A083
>
> 2
>
> AMOUNT  1
> ID      6A1B47A0-1895-11DE-A201000C7674A083
>
> -------
>
> Then i want to loop the array and perform a createData action, when i
> have one item in the array it works, when i have 2 items in the array
> it doesn't work.
>
> I thought it must be because somehow the createData creates a sort of
> duplicate record error, but then again, i use the [i] to address only
> the current array loop item.
>
> I don't see it anymore, anyone had a fresh insight?
>
> <cfset sailsobj = createObject
> ('component',application.stcoapi.shopproductbehaviour_sails.packagepath) /
> >
>
> <cfloop index="i" from="1" to="#arraylen(session.shopcart)#">
>
> <!--- set product sails --->
> <cfset sailsprops.productobjectid = session.shopcart[i].id>
> <cfset sailsprops.productamount = session.shopcart[i].amount>
> <cfset sailsobj.createData(stProperties=sailsprops)>
>
>  </cfloop>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to