Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Queries QB record object.
<!---
Name: record.cfm
Author: Gernot Bartels
Description: Queries QB for record object.
If record ID exists, update;
Otherwise create new record.
Prevents duplicates.
History: Created
Added logic
Usage: Surveys, Intake,
Created: 2011-08-05
Updated: 2012-02-15
--->
<!--- return record object --->
<cfinvoke component="components.qbQuery" method="qFieldVal" returnvariable="recordObject">
<cfinvokeargument name="qbURL" value="#qbURL#" />
<cfinvokeargument name="theTable" value="#tableID#" />
<cfinvokeargument name="theTicket" value="#ticket#" />
<cfinvokeargument name="theToken" value="#token#" />
<cfinvokeargument name="theField" value="#uField#" />
<cfinvokeargument name="theValue" value="#uValue#" />
<cfinvokeargument name="theList" value="#uList#" />
</cfinvoke>
<!--- check returned object for record ID --->
<cfif isDefined("recordObject.qdbapi.record.XmlAttributes.rid")><!--- update record --->
<cfset recordID = #recordObject.qdbapi.record.XmlAttributes.rid# >
<cfinvoke component="components.qbAPI" method="updateRecord" returnvariable="Record">
<cfinvokeargument name="qbURL" value="#qbURL#" />
<cfinvokeargument name="tableID" value="#tableID#" />
<cfinvokeargument name="recordID" value="#recordID#" />
<cfinvokeargument name="content" value="#qb_xml#" />
<cfinvokeargument name="theTicket" value="#ticket#" />
<cfinvokeargument name="theToken" value="#token#" />
</cfinvoke>
<cfoutput>
from record update:</br>
#Record#</br>
</cfoutput>
<cfelse><!--- create record --->
<cfinvoke component="components.qbAPI" method="createRecord" returnvariable="Record">
<cfinvokeargument name="qbURL" value="#qbURL#" />
<cfinvokeargument name="tableID" value="#tableID#" />
<cfinvokeargument name="newRecord" value="#qb_xml#" />
<cfinvokeargument name="theTicket" value="#ticket#" />
<cfinvokeargument name="theToken" value="#token#" />
</cfinvoke>
<cfoutput>
from record create:</br>
#Record#</br>
</cfoutput>
</cfif>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.