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