Hi Derek, The arguments.stProperties is not the whole object, just the stProperties passed to setData().
Often you only pass some properties through to be saved. The only property you can be sure of receiving is objectid. Im not sure if this is your issue or if their is something more sinister going on. Can you try this for me? <!--- ------------ ---> <cfset var stObject = structNew() /><!--- put this up top obviously ---> <cfset stObject = getData(objectid=arguments.stProperties.objectid) /> <cfset confFU=oFU.getFU(stObject.parentid) /> <cfset thisFU="#confFU#/#stObject.fu#" /> <!--- -------------- ---> Kind regards -- -- Matthew Bryant Product Development Manager Daemon Internet Consultants Adobe Solutions Partner http://www.daemon.com.au/ p. 02 9380 4162 f. 02 9380 4204 On 30/06/2007, at 4:58 AM, Derek Westfall wrote: > > Matthew, > > Is there anything unusual about the stProperties that get passed to > the > AfterSave function? Or does having an aftersave function like this > create a > nested loop? Ie aftersave calls aftersave calls aftersave, eventually > corrupting the properties? > > > Here is the aftersave function I added to my custom type. It chokes > on: > > <cfset confFU=oFU.getFU(arguments.stProperties.parentid) /> > > With: Element STPROPERTIES.PARENTID is undefined in ARGUMENTS. > > If I insert <cfoutput>#arguments.stProperties.parentid#"</ > cfoutput><cfabort> > right before this line, the value displays. > > Thanks, > > Derek > > > > <cffunction name="aftersave" access="public" hint="Updates FU after > save" > returntype="struct" output="false"> > <cfargument name="stProperties" required="yes" hint="Properties > of the > object being saved"> > <cfset var oFU = > CreateObject("component","#Application.packagepath#.farcry.fu") /> > <cfset var stForm=structnew() /> > <cfset var stResult=structnew() /> > <cfset var confFU="" /> > <cfset var thisFU="" /> > > <!--- set the new FU ---> > > <cfset confFU=oFU.getFU(arguments.stProperties.parentid) /> > <cfset thisFU="#confFU#/#arguments.stProperties.fu#" /> > > <!--- delete all FUs for this objectid ---> > <cfset stForm.lDeleteObjectid=arguments.stProperties.objectid /> > <cfset oFU.fDelete(stForm) /> > > <!--- delete any mapping for this FU just in case ---> > <cfset oFU.deletemapping(thisFU) /> > > <!--- set to FU ---> > <cfset oFU.setFU > (objectid=arguments.stProperties.objectid,alias=thisFU) /> > > <cfset stResult=super.afterSave > (stProperties=arguments.stProperties) /> > <cfreturn stResult /> > </cffunction> > > ________________________________ > > From: [email protected] [mailto:farcry- > [EMAIL PROTECTED] On > Behalf Of Matthew Bryant > Sent: Thursday, June 14, 2007 7:14 PM > To: [email protected] > Subject: [farcry-dev] Re: AfterSave > > > Hi Derek, > > If you create an afterSave function in your custom type, you will > need to > call super.afterSave (probably first thing) in order for it to run. > Same > goes for delete. > > Kind regards > > -- > -- Matthew Bryant > Product Development Manager > Daemon Internet Consultants > Adobe Solutions Partner > http://www.daemon.com.au/ > p. 02 9380 4162 > f. 02 9380 4204 > > > > > On 15/06/2007, at 8:09 AM, Derek Westfall wrote: > > > If I want to add an AfterSave function to my custom type, do I need > to include all the logic in the types.cfc AfterSave function? Or > will my > AfterSave function run after the types.cfc AfterSave function? > > Same question for Delete function? > Thank you, > Derek Westfall > > > > > ________________________________ > > Message protected by MailGuard: e-mail anti-virus, anti-spam and > content filtering. > http://www.mailguard.com.au/mg > > > > > > > > > > > > > -- > Message protected by MailGuard: e-mail anti-virus, anti-spam and > content filtering. > http://www.mailguard.com.au/mg > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "farcry-dev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/farcry-dev?hl=en -~----------~----~----~----~------~----~------~--~---
