Here is code I use in a custom tag. It assumes you know the ID of the
container, but it could be modified to take a list of IDs or scan all
containers.

This code has only been tested a bit. It has NOT gone through rigourous real
world testing. This code has no warranty. If you use this code and something
awful happens, I'm really sorry, but I can't help you. Etc. Etc. Etc. :)

Oh, this code assumes the use of 'Basic Schedule' rule, and assumes it's the
only one there. Oh, it will fail if the container _doesn't_ have the rule,
but in my case, I'm using specific containers, so it's ok.

Code:

<CFPARAM NAME="Attributes.DataSource">
<CFPARAM NAME="Attributes.ContainerID">
<CFPARAM NAME="Attributes.ObjectID">

<CFA_ContentObjectGet DataSource="#Attributes.DataSource#"
ObjectID="#Attributes.ContainerID#" r_stObject="container">
<CFSET Group1 = Container.ARules[1].AStartOrder[1]>

<CFA_ContentObject DataSource="#Attributes.DataSource#"
ObjectID="#Attributes.ContainerID#.aRules[1]" Method="GetInvocations"
r_stParams="gresults">
<!--- gresults should have one key. In our case, we get the first key, and
assume it's the only key --->
<!--- I use a list function just to be extra careful. --->
<CFSET Ob = ListFirst(StructKeyList(GResults))>
<CFSET Ainvocations = GResults[Ob].AInvocations>

<CFLOOP INDEX="X" FROM=1 TO="#ArrayLen(Ainvocations)#">
        <CFIF AInvocations[X].objectID IS Attributes.objectID>
                <CFSET KillStr = "#Group1#&#X#">
        </CFIF>
</CFLOOP>

<!--- Now kill it --->
<CFIF IsDefined("KillStr")>
        <CFSET ParamsToKill = StructNew()>
        <CFSET ParamsToKill.lInvocationKeys = KillStr>
        <CFA_ContentObject DataSource="#Attributes.DataSource#"
ObjectID="#Attributes.ContainerID#.aRules[1]" Method="DeleteInvocations"
stParams="#ParamsToKill#">
</CFIF>


=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email   : [EMAIL PROTECTED]
ICQ UIN : 3679482

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: Margaret Cook [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 2:23 PM
> To: Spectra-Talk
> Subject: Delete object from containers (after object has been deleted)
>
>
> Hello Everyone,
> This is a newbie question. If I delete an object in the webtop - before
> removing it from it's respectable containers - what do I need to
> do to now
> remove it from the containers? If I try and edit a container that
> contained
> the object I get an error message:
> The member "74C2DBD1-A782-11D4-BA0600C04FA358B2" in dimension 1 of object
> "stTypeMethods" cannot be found. Please, modify the member name.
>
> TIA
> maggie
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to