createData in cfloop array question?
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 (writes new record to database) 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 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.id>
<cfset sailsprops.productamount = session.shopcart.amount>
<cfset sailsobj.createData(stProperties=sailsprops)>
</cfloop
