Solved

multiple cfinvokes and one url variable

Posted on 2004-04-26
6
420 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 17

Assisted Solution

by:Tacobell777
Tacobell777 earned 250 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 250 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
Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

 

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

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…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 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