[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

multiple cfinvokes and one url variable

Posted on 2004-04-26
6
Medium Priority
?
439 Views
Last Modified: 2013-12-24
in the below the first cfinvoke returns variable 'anOID'

how do i reference this as an arguemnt passed to the next cfinvoke?

also , did i correctly reference the URL id?

<cfif isDefined("url.addProdID")>
<cfinvoke component="api/cartservice" method="newCart" >
</cfinvoke>
<cfinvoke component="api/cartservice" method="addCartItem" >
<cfinvokeargument name="cartoid" value="anOID">
<cfinvokeargument name="itemoid" value="url.addProdID">
<cfinvokeargument name="quantity" value="1">
</cfinvoke>
</cfif>
0
Comment
Question by:finnstone
  • 4
6 Comments
 
LVL 17

Assisted Solution

by:Tacobell777
Tacobell777 earned 1000 total points
ID: 10924521
<cfinvokeargument name="itemoid" value="url.addProdID"> should be <cfinvokeargument name="itemoid" value="#url.addProdID#">
Not sure what your after with your first question?
0
 

Author Comment

by:finnstone
ID: 10924537
well the newCart method returns a variable using cfreturn calling anOID, i was wondering how i can refer to it now that it has been returned?

do i need #s
0
 
LVL 18

Accepted Solution

by:
Plucka earned 1000 total points
ID: 10924538
Hi finnstone,

On your first <cfinvoke specify the returnvariable

<cfinvoke component="api/cartservice" method="newCart" returnvariable="anOID">

On your call use that variable.

<cfinvokeargument name="cartoid" value="#anOID#">

Did you know you can do this.

<cfinvoke component="api/cartservice" method="addCartItem" cartoid="#anOID#" itemoid="#url.addProdID#" quantity="1">

All on one line.

Regards
Plucka
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 

Author Comment

by:finnstone
ID: 10924544
thx guys
0
 

Author Comment

by:finnstone
ID: 10924743
i got this error that anOID is undefined


Variable ANOID is undefined.

The error occurred in line 13

 
11 : </cfinvoke>
12 : <cfinvoke component="htmlcartservice" method="addCartItem" >
13 : <cfinvokeargument name="cartoid" value="#anOID#">
14 : <cfinvokeargument name="itemoid" value="#url.addProdID#">
15 : <cfinvokeargument name="quantity" value="1">

 
0
 

Author Comment

by:finnstone
ID: 10924818
never mind i got it heres the whole thing



<cfif isDefined("url.addProdID")>
<cfinvoke component="htmlcartservice" method="newCart" returnvariable="anOID" >
</cfinvoke>
<cfinvoke component="htmlcartservice" method="addCartItem" >
<cfinvokeargument name="cartoid" value="#anOID#">
<cfinvokeargument name="itemoid" value="#url.addProdID#">
<cfinvokeargument name="quantity" value="1">
</cfinvoke>
</cfif>
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month19 days, 22 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question