ColdFusion CFscript - Invoke a component in script

cfscript - invoke component


<cfcomponent displayname="ArtsCFC" hint="Art Discover">
 <cffunction name="GetArts" access="remote" returntype="query">
  <cfargument name="ArtistID" type="numeric" required="yes">
  <cfargument name="MaximumPrice" type="numeric" required="yes">

        <cfquery name="ArtDetails" datasource="cfcodeexplorer">
        Select ArtName, Description, Price
        From ART Where ArtistID = #arguments.ArtistID# And Price <= #arguments.MaximumPrice#

  <cfreturn ArtDetails>


<!DOCTYPE html>

<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>How to invoke component in cfscript tag</title>

<h2 style="color:DarkBlue; font-style:italic">
 How to invoke component in cfscript tag
<hr width="400" align="left" color="PowderBlue" />  
<br />

 artsObject = CreateObject("component","artscomponent");
 artistID = 1;
 maximumPrice = 13000;
 arts = artsObject.GetArts(artistID,maximumPrice);

<cfdump var="#arts#">