Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.            
  2.     <cffunction name="getPreview" output="true" access="public" returntype="query" >
  3.         <cfargument name="myStruct" required="true" type="struct" hint=" The form to turn into a query " />
  4.         <cfargument name="myOriginalQuery" required="true" type="query"  hint=" The Original Query " />
  5.         <cfparam name="arguments.myStruct.preview" default="0">
  6.         <!--- Check to see if you are preveiwing a contant item --->
  7.         <cfif  arguments.myStruct.preview EQ 1  >
  8.                  <!--- If we are, create an empty query using the ColumnList of the original query and populate it with the form values --->
  9.              <cfreturn    structToQueryRow( queryNew(arguments.myOriginalQuery.ColumnList) , arguments.myStruct) />
  10.         <cfelse>    <!--- If not return the origial query --->
  11.              <cfreturn   arguments.myOriginalQuery />
  12.         </cfif>
  13.     </cffunction>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement