Solved

multiple cfinvokes and one url variable

Posted on 2004-04-26
6
412 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 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
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 …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now