Multiple inserts while using bSessionOnly="true" with related arrays

View: New views
14 Messages — Rating Filter:   Alert me  

Multiple inserts while using bSessionOnly="true" with related arrays

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


OK, i have a custom type that uses bSessionOnly="true" so i can set
the properties.
In the type i can use 2 array related fields, dmfile and dmimage.

I have only one obj.createData in the "processForm" and the
processForm action name is unique to others on the same page...

Still, when i execute the code i get two db inserts, one is using the
properties like i stated in my custom code:

<!--- write email to db --->
<cfset obj = createObject
('component',application.stcoapi.emailberichten.typePath) />
<cfset stprops = {} />
<cfset stprops.emailadresontvanger = emailadresontvangerlist />
<cfset stprops.emailadresverzender = emailadresverzender.emailadres />
<cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
<cfset stprops.emailtekst = stemailberichten.emailtekst />
<cfset stprops.label = stemailberichten.emailonderwerp />
<cfset obj.createData(stProperties=stprops) />

The other record inserts like it should when you don't use a
bSessionOnly="true".

Any insights, is it because there are related arrays involved???

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Tomek Kott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

it would probably help if you gave the entire "processForm" tag code, unless the code you gave is the only thing in there.

On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <marcovandenoever@...> wrote:

OK, i have a custom type that uses bSessionOnly="true" so i can set
the properties.
In the type i can use 2 array related fields, dmfile and dmimage.

I have only one obj.createData in the "processForm" and the
processForm action name is unique to others on the same page...

Still, when i execute the code i get two db inserts, one is using the
properties like i stated in my custom code:

<!--- write email to db --->
<cfset obj = createObject
('component',application.stcoapi.emailberichten.typePath) />
<cfset stprops = {} />
<cfset stprops.emailadresontvanger = emailadresontvangerlist />
<cfset stprops.emailadresverzender = emailadresverzender.emailadres />
<cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
<cfset stprops.emailtekst = stemailberichten.emailtekst />
<cfset stprops.label = stemailberichten.emailonderwerp />
<cfset obj.createData(stProperties=stprops) />

The other record inserts like it should when you don't use a
bSessionOnly="true".

Any insights, is it because there are related arrays involved???

Thanks.



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


OK here it is:




<ft:processForm action="Verzenden" exit="true">

<ft:processFormObjects typename="emailberichten" bSessionOnly="true" /
>

<!--- if a emailberichten object was succesfully saved --->
<cfif len(lSavedObjectIDs)>

<!--- get the emailberichten object data to get other relative data
that needs to be included --->
<cfset stemailberichten = getData(objectid=lSavedObjectIDs) />

<!--- get the emailadresverzender emailaddress --->
<cfset obj = createObject
('component',application.stcoapi.emailaccounts.typePath) />
<cfset emailadresverzender = obj.getdata
(objectid=stemailberichten.aemailaccounts) />

<!--- loop over the selected contactpersonen --->
<cfloop index="i" array="#stemailberichten.acontactpersonen#">

<!--- set incrementing custom currentrow variable so based on that
value we can set or don't set some other variables --->
<cfparam name="currentrow" default="0">
<cfset currentrow = currentrow + 1>

<!--- get current contactpersonen item based on current
acontactpersonen loop array item --->
<cfset obj = createObject
('component',application.stcoapi.contactpersonen.typePath) />
<cfset contactpersoon = obj.getdata(objectid=i) />

<!--- set default emailadresontvangerlist variable value to use if one
emailadresontvanger exists, or as default variable to further build a
loop building list, only set this variable when currentrow is 1 as it
is only used when there is only one emailadresontvanger --->
<cfif currentrow eq "1">
<cfset emailadresontvangerlist = contactpersoon.emailadres>
</cfif>

<!--- if there are more then one emailadresontvangers, add them to
list, only set this variable when currentrow is not 1 as it is only
used when there are more then one emailadresontvangers, also when used
in currentrow 1 it would duplicate the previous set
emailadresontvangerlist variable --->
<cfif arraylen(stemailberichten.acontactpersonen) gte 2 and currentrow
neq "1">
<cfset emailadresontvangerlist = emailadresontvangerlist & "," &
contactpersoon.emailadres>
</cfif>

</cfloop>

<!--- write email to db --->
<cfset obj = createObject
('component',application.stcoapi.emailberichten.typePath) />
<cfset stprops = {} />
<cfset stprops.emailadresontvanger = emailadresontvangerlist />
<cfset stprops.emailadresverzender = emailadresverzender.emailadres />
<cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
<cfset stprops.emailtekst = stemailberichten.emailtekst />
<cfset stprops.label = stemailberichten.emailonderwerp />
<cfset obj.createData(stProperties=stprops) />

<!--- set message id for cfmail --->
<cfset messageid = listlast(stobj.emailadresontvanger,"@")>
<cfset messageid = createuuid() & "@" & messageid>

<!--- send the email --->
<cfmail type="html"
from="#emailadresverzender.emailadres#"
to="#emailadresontvangerlist#"
subject="#stemailberichten.emailonderwerp# -
###stemailberichten.objectid#">
        #stemailberichten.emailonderwerp# -
###stemailberichten.objectid#
                <br />
        <br />
        #replace(stemailberichten.emailtekst,Chr(13),"<br>", "all")
#<br />
        <br />
        <br />
        Vriendelijke groeten,
                <br />
                <br />
                #session.dmprofile.firstname# #session.dmprofile.lastname#.
                <br />
        <br />
        http://#cgi.http_host#<br />

<!--- if a file is submitted in the email --->
<cfif arraylen(stemailberichten.aemailbestanden)>

<!--- loop over the selected emailbestanden --->
<cfloop index="i" array="#stemailberichten.aemailbestanden#">

<!--- get current dmfile item based on current aemailbestanden loop
array item --->
<cfset obj = createObject
('component',application.stcoapi.dmfile.typePath) />
<cfset emailbestand = obj.getdata(objectid=i) />

<!--- set file path --->
<cfset file = "http://www." & listlast
(emailadresverzender.emailadres,"@") & "/
files#emailbestand.filename#">

<!--- set cfmailparam with current loop file --->
<cfmailparam file="#file#">
</cfloop>

</cfif>

<!--- if a image is submitted in the email --->
<cfif arraylen(stemailberichten.aemailafbeeldingen)>

<!--- loop over the selected emailafbeeldingen --->
<cfloop index="i" array="#stemailberichten.aemailafbeeldingen#">

<!--- get current dmimage item based on current aemailafbeeldingen
loop array item --->
<cfset obj = createObject
('component',application.stcoapi.dmimage.typePath) />
<cfset emailafbeelding = obj.getdata(objectid=i) />

<!--- set image path --->
<cfset file = "http://www." & listlast
(emailadresverzender.emailadres,"@") & emailafbeelding.sourceimage>

<!--- set cfmailparam with current loop file --->
<cfmailparam file="#file#">
</cfloop>

</cfif>

<cfmailparam name="Message-Id" value="<#messageid#>">
<cfmailparam name="Reply-To" value="#emailadresverzender.emailadres#">
<cfmailparam name="MIME-Version" value="1.0">

</cfmail>

</cfif>

</ft:processForm>




On Oct 28, 9:04 pm, Tomek Kott <tkott.s...@...> wrote:

> it would probably help if you gave the entire "processForm" tag code, unless
> the code you gave is the only thing in there.
>
> On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <
>
> marcovandenoe...@...> wrote:
>
> > OK, i have a custom type that uses bSessionOnly="true" so i can set
> > the properties.
> > In the type i can use 2 array related fields, dmfile and dmimage.
>
> > I have only one obj.createData in the "processForm" and the
> > processForm action name is unique to others on the same page...
>
> > Still, when i execute the code i get two db inserts, one is using the
> > properties like i stated in my custom code:
>
> > <!--- write email to db --->
> > <cfset obj = createObject
> > ('component',application.stcoapi.emailberichten.typePath) />
> > <cfset stprops = {} />
> > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > <cfset stprops.label = stemailberichten.emailonderwerp />
> > <cfset obj.createData(stProperties=stprops) />
>
> > The other record inserts like it should when you don't use a
> > bSessionOnly="true".
>
> > Any insights, is it because there are related arrays involved???
>
> > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Tomek Kott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

you're right, it seems that either bSessionOnly is not working, or something else is going on. I'm trying to remember if for some reason the db saving has to happen twice because of the arrays or something similar.

Have you tried tracing this through? I don't have any clues for you, sorry.

On Wed, Oct 28, 2009 at 4:20 PM, Marco van den Oever <marcovandenoever@...> wrote:

OK here it is:




<ft:processForm action="Verzenden" exit="true">

<ft:processFormObjects typename="emailberichten" bSessionOnly="true" /
>

<!--- if a emailberichten object was succesfully saved --->
<cfif len(lSavedObjectIDs)>

<!--- get the emailberichten object data to get other relative data
that needs to be included --->
<cfset stemailberichten = getData(objectid=lSavedObjectIDs) />

<!--- get the emailadresverzender emailaddress --->
<cfset obj = createObject
('component',application.stcoapi.emailaccounts.typePath) />
<cfset emailadresverzender = obj.getdata
(objectid=stemailberichten.aemailaccounts) />

<!--- loop over the selected contactpersonen --->
<cfloop index="i" array="#stemailberichten.acontactpersonen#">

<!--- set incrementing custom currentrow variable so based on that
value we can set or don't set some other variables --->
<cfparam name="currentrow" default="0">
<cfset currentrow = currentrow + 1>

<!--- get current contactpersonen item based on current
acontactpersonen loop array item --->
<cfset obj = createObject
('component',application.stcoapi.contactpersonen.typePath) />
<cfset contactpersoon = obj.getdata(objectid=i) />

<!--- set default emailadresontvangerlist variable value to use if one
emailadresontvanger exists, or as default variable to further build a
loop building list, only set this variable when currentrow is 1 as it
is only used when there is only one emailadresontvanger --->
<cfif currentrow eq "1">
<cfset emailadresontvangerlist = contactpersoon.emailadres>
</cfif>

<!--- if there are more then one emailadresontvangers, add them to
list, only set this variable when currentrow is not 1 as it is only
used when there are more then one emailadresontvangers, also when used
in currentrow 1 it would duplicate the previous set
emailadresontvangerlist variable --->
<cfif arraylen(stemailberichten.acontactpersonen) gte 2 and currentrow
neq "1">
<cfset emailadresontvangerlist = emailadresontvangerlist & "," &
contactpersoon.emailadres>
</cfif>

</cfloop>

<!--- write email to db --->
<cfset obj = createObject
('component',application.stcoapi.emailberichten.typePath) />
<cfset stprops = {} />
<cfset stprops.emailadresontvanger = emailadresontvangerlist />
<cfset stprops.emailadresverzender = emailadresverzender.emailadres />
<cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
<cfset stprops.emailtekst = stemailberichten.emailtekst />
<cfset stprops.label = stemailberichten.emailonderwerp />
<cfset obj.createData(stProperties=stprops) />

<!--- set message id for cfmail --->
<cfset messageid = listlast(stobj.emailadresontvanger,"@")>
<cfset messageid = createuuid() & "@" & messageid>

<!--- send the email --->
<cfmail type="html"
from="#emailadresverzender.emailadres#"
to="#emailadresontvangerlist#"
subject="#stemailberichten.emailonderwerp# -
###stemailberichten.objectid#">
       #stemailberichten.emailonderwerp# -
###stemailberichten.objectid#
               <br />
       <br />
       #replace(stemailberichten.emailtekst,Chr(13),"<br>", "all")
#<br />
       <br />
       <br />
       Vriendelijke groeten,
               <br />
               <br />
               #session.dmprofile.firstname# #session.dmprofile.lastname#.
               <br />
       <br />
       http://#cgi.http_host#<br />

<!--- if a file is submitted in the email --->
<cfif arraylen(stemailberichten.aemailbestanden)>

<!--- loop over the selected emailbestanden --->
<cfloop index="i" array="#stemailberichten.aemailbestanden#">

<!--- get current dmfile item based on current aemailbestanden loop
array item --->
<cfset obj = createObject
('component',application.stcoapi.dmfile.typePath) />
<cfset emailbestand = obj.getdata(objectid=i) />

<!--- set file path --->
<cfset file = "http://www." & listlast
(emailadresverzender.emailadres,"@") & "/
files#emailbestand.filename#">

<!--- set cfmailparam with current loop file --->
<cfmailparam file="#file#">
</cfloop>

</cfif>

<!--- if a image is submitted in the email --->
<cfif arraylen(stemailberichten.aemailafbeeldingen)>

<!--- loop over the selected emailafbeeldingen --->
<cfloop index="i" array="#stemailberichten.aemailafbeeldingen#">

<!--- get current dmimage item based on current aemailafbeeldingen
loop array item --->
<cfset obj = createObject
('component',application.stcoapi.dmimage.typePath) />
<cfset emailafbeelding = obj.getdata(objectid=i) />

<!--- set image path --->
<cfset file = "http://www." & listlast
(emailadresverzender.emailadres,"@") & emailafbeelding.sourceimage>

<!--- set cfmailparam with current loop file --->
<cfmailparam file="#file#">
</cfloop>

</cfif>

<cfmailparam name="Message-Id" value="<#messageid#>">
<cfmailparam name="Reply-To" value="#emailadresverzender.emailadres#">
<cfmailparam name="MIME-Version" value="1.0">

</cfmail>

</cfif>

</ft:processForm>




On Oct 28, 9:04 pm, Tomek Kott <tkott.s...@...> wrote:
> it would probably help if you gave the entire "processForm" tag code, unless
> the code you gave is the only thing in there.
>
> On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <
>
> marcovandenoe...@...> wrote:
>
> > OK, i have a custom type that uses bSessionOnly="true" so i can set
> > the properties.
> > In the type i can use 2 array related fields, dmfile and dmimage.
>
> > I have only one obj.createData in the "processForm" and the
> > processForm action name is unique to others on the same page...
>
> > Still, when i execute the code i get two db inserts, one is using the
> > properties like i stated in my custom code:
>
> > <!--- write email to db --->
> > <cfset obj = createObject
> > ('component',application.stcoapi.emailberichten.typePath) />
> > <cfset stprops = {} />
> > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > <cfset stprops.label = stemailberichten.emailonderwerp />
> > <cfset obj.createData(stProperties=stprops) />
>
> > The other record inserts like it should when you don't use a
> > bSessionOnly="true".
>
> > Any insights, is it because there are related arrays involved???
>
> > Thanks.



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


When i don't use bSessionOnly and comment out the custom createdata
code, i only see one record, so that works.

When i do use  bSessionOnly, leave the custom createdata code active,
comment out all the array related stuff, then only one record is
inserted...

Based on that i assume it's array related...

On Oct 28, 9:25 pm, Tomek Kott <tkott.s...@...> wrote:

> you're right, it seems that either bSessionOnly is not working, or something
> else is going on. I'm trying to remember if for some reason the db saving
> has to happen twice because of the arrays or something similar.
>
> Have you tried tracing this through? I don't have any clues for you, sorry.
>
> On Wed, Oct 28, 2009 at 4:20 PM, Marco van den Oever <
>
> marcovandenoe...@...> wrote:
>
> > OK here it is:
>
> > <ft:processForm action="Verzenden" exit="true">
>
> > <ft:processFormObjects typename="emailberichten" bSessionOnly="true" /
>
> > <!--- if a emailberichten object was succesfully saved --->
> > <cfif len(lSavedObjectIDs)>
>
> > <!--- get the emailberichten object data to get other relative data
> > that needs to be included --->
> > <cfset stemailberichten = getData(objectid=lSavedObjectIDs) />
>
> > <!--- get the emailadresverzender emailaddress --->
> > <cfset obj = createObject
> > ('component',application.stcoapi.emailaccounts.typePath) />
> > <cfset emailadresverzender = obj.getdata
> > (objectid=stemailberichten.aemailaccounts) />
>
> > <!--- loop over the selected contactpersonen --->
> > <cfloop index="i" array="#stemailberichten.acontactpersonen#">
>
> > <!--- set incrementing custom currentrow variable so based on that
> > value we can set or don't set some other variables --->
> > <cfparam name="currentrow" default="0">
> > <cfset currentrow = currentrow + 1>
>
> > <!--- get current contactpersonen item based on current
> > acontactpersonen loop array item --->
> > <cfset obj = createObject
> > ('component',application.stcoapi.contactpersonen.typePath) />
> > <cfset contactpersoon = obj.getdata(objectid=i) />
>
> > <!--- set default emailadresontvangerlist variable value to use if one
> > emailadresontvanger exists, or as default variable to further build a
> > loop building list, only set this variable when currentrow is 1 as it
> > is only used when there is only one emailadresontvanger --->
> > <cfif currentrow eq "1">
> > <cfset emailadresontvangerlist = contactpersoon.emailadres>
> > </cfif>
>
> > <!--- if there are more then one emailadresontvangers, add them to
> > list, only set this variable when currentrow is not 1 as it is only
> > used when there are more then one emailadresontvangers, also when used
> > in currentrow 1 it would duplicate the previous set
> > emailadresontvangerlist variable --->
> > <cfif arraylen(stemailberichten.acontactpersonen) gte 2 and currentrow
> > neq "1">
> > <cfset emailadresontvangerlist = emailadresontvangerlist & "," &
> > contactpersoon.emailadres>
> > </cfif>
>
> > </cfloop>
>
> > <!--- write email to db --->
> > <cfset obj = createObject
> > ('component',application.stcoapi.emailberichten.typePath) />
> > <cfset stprops = {} />
> > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > <cfset stprops.label = stemailberichten.emailonderwerp />
> > <cfset obj.createData(stProperties=stprops) />
>
> > <!--- set message id for cfmail --->
> > <cfset messageid = listlast(stobj.emailadresontvanger,"@")>
> > <cfset messageid = createuuid() & "@" & messageid>
>
> > <!--- send the email --->
> > <cfmail type="html"
> > from="#emailadresverzender.emailadres#"
> > to="#emailadresontvangerlist#"
> > subject="#stemailberichten.emailonderwerp# -
> > ###stemailberichten.objectid#">
> >        #stemailberichten.emailonderwerp# -
> > ###stemailberichten.objectid#
> >                <br />
> >        <br />
> >        #replace(stemailberichten.emailtekst,Chr(13),"<br>", "all")
> > #<br />
> >        <br />
> >        <br />
> >        Vriendelijke groeten,
> >                <br />
> >                <br />
> >                #session.dmprofile.firstname# #session.dmprofile.lastname#.
> >                <br />
> >        <br />
> >        http://#cgi.http_host#<br />
>
> > <!--- if a file is submitted in the email --->
> > <cfif arraylen(stemailberichten.aemailbestanden)>
>
> > <!--- loop over the selected emailbestanden --->
> > <cfloop index="i" array="#stemailberichten.aemailbestanden#">
>
> > <!--- get current dmfile item based on current aemailbestanden loop
> > array item --->
> > <cfset obj = createObject
> > ('component',application.stcoapi.dmfile.typePath) />
> > <cfset emailbestand = obj.getdata(objectid=i) />
>
> > <!--- set file path --->
> > <cfset file = "http://www." & listlast
> > (emailadresverzender.emailadres,"@") & "/
> > files#emailbestand.filename#">
>
> > <!--- set cfmailparam with current loop file --->
> > <cfmailparam file="#file#">
> > </cfloop>
>
> > </cfif>
>
> > <!--- if a image is submitted in the email --->
> > <cfif arraylen(stemailberichten.aemailafbeeldingen)>
>
> > <!--- loop over the selected emailafbeeldingen --->
> > <cfloop index="i" array="#stemailberichten.aemailafbeeldingen#">
>
> > <!--- get current dmimage item based on current aemailafbeeldingen
> > loop array item --->
> > <cfset obj = createObject
> > ('component',application.stcoapi.dmimage.typePath) />
> > <cfset emailafbeelding = obj.getdata(objectid=i) />
>
> > <!--- set image path --->
> > <cfset file = "http://www." & listlast
> > (emailadresverzender.emailadres,"@") & emailafbeelding.sourceimage>
>
> > <!--- set cfmailparam with current loop file --->
> > <cfmailparam file="#file#">
> > </cfloop>
>
> > </cfif>
>
> > <cfmailparam name="Message-Id" value="<#messageid#>">
> > <cfmailparam name="Reply-To" value="#emailadresverzender.emailadres#">
> > <cfmailparam name="MIME-Version" value="1.0">
>
> > </cfmail>
>
> > </cfif>
>
> > </ft:processForm>
>
> > On Oct 28, 9:04 pm, Tomek Kott <tkott.s...@...> wrote:
> > > it would probably help if you gave the entire "processForm" tag code,
> > unless
> > > the code you gave is the only thing in there.
>
> > > On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <
>
> > > marcovandenoe...@...> wrote:
>
> > > > OK, i have a custom type that uses bSessionOnly="true" so i can set
> > > > the properties.
> > > > In the type i can use 2 array related fields, dmfile and dmimage.
>
> > > > I have only one obj.createData in the "processForm" and the
> > > > processForm action name is unique to others on the same page...
>
> > > > Still, when i execute the code i get two db inserts, one is using the
> > > > properties like i stated in my custom code:
>
> > > > <!--- write email to db --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > <cfset stprops = {} />
> > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > The other record inserts like it should when you don't use a
> > > > bSessionOnly="true".
>
> > > > Any insights, is it because there are related arrays involved???
>
> > > > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Strange thing is that i only use getdata for the related arrays, so
that shouldn't create any extra record.
But it must be the presence of those array fields in the ft:object
that indeed trigger some stuff.

On Oct 28, 9:43 pm, Marco van den Oever <marcovandenoe...@...>
wrote:

> When i don't use bSessionOnly and comment out the custom createdata
> code, i only see one record, so that works.
>
> When i do use  bSessionOnly, leave the custom createdata code active,
> comment out all the array related stuff, then only one record is
> inserted...
>
> Based on that i assume it's array related...
>
> On Oct 28, 9:25 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > you're right, it seems that either bSessionOnly is not working, or something
> > else is going on. I'm trying to remember if for some reason the db saving
> > has to happen twice because of the arrays or something similar.
>
> > Have you tried tracing this through? I don't have any clues for you, sorry.
>
> > On Wed, Oct 28, 2009 at 4:20 PM, Marco van den Oever <
>
> > marcovandenoe...@...> wrote:
>
> > > OK here it is:
>
> > > <ft:processForm action="Verzenden" exit="true">
>
> > > <ft:processFormObjects typename="emailberichten" bSessionOnly="true" /
>
> > > <!--- if a emailberichten object was succesfully saved --->
> > > <cfif len(lSavedObjectIDs)>
>
> > > <!--- get the emailberichten object data to get other relative data
> > > that needs to be included --->
> > > <cfset stemailberichten = getData(objectid=lSavedObjectIDs) />
>
> > > <!--- get the emailadresverzender emailaddress --->
> > > <cfset obj = createObject
> > > ('component',application.stcoapi.emailaccounts.typePath) />
> > > <cfset emailadresverzender = obj.getdata
> > > (objectid=stemailberichten.aemailaccounts) />
>
> > > <!--- loop over the selected contactpersonen --->
> > > <cfloop index="i" array="#stemailberichten.acontactpersonen#">
>
> > > <!--- set incrementing custom currentrow variable so based on that
> > > value we can set or don't set some other variables --->
> > > <cfparam name="currentrow" default="0">
> > > <cfset currentrow = currentrow + 1>
>
> > > <!--- get current contactpersonen item based on current
> > > acontactpersonen loop array item --->
> > > <cfset obj = createObject
> > > ('component',application.stcoapi.contactpersonen.typePath) />
> > > <cfset contactpersoon = obj.getdata(objectid=i) />
>
> > > <!--- set default emailadresontvangerlist variable value to use if one
> > > emailadresontvanger exists, or as default variable to further build a
> > > loop building list, only set this variable when currentrow is 1 as it
> > > is only used when there is only one emailadresontvanger --->
> > > <cfif currentrow eq "1">
> > > <cfset emailadresontvangerlist = contactpersoon.emailadres>
> > > </cfif>
>
> > > <!--- if there are more then one emailadresontvangers, add them to
> > > list, only set this variable when currentrow is not 1 as it is only
> > > used when there are more then one emailadresontvangers, also when used
> > > in currentrow 1 it would duplicate the previous set
> > > emailadresontvangerlist variable --->
> > > <cfif arraylen(stemailberichten.acontactpersonen) gte 2 and currentrow
> > > neq "1">
> > > <cfset emailadresontvangerlist = emailadresontvangerlist & "," &
> > > contactpersoon.emailadres>
> > > </cfif>
>
> > > </cfloop>
>
> > > <!--- write email to db --->
> > > <cfset obj = createObject
> > > ('component',application.stcoapi.emailberichten.typePath) />
> > > <cfset stprops = {} />
> > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > <cfset obj.createData(stProperties=stprops) />
>
> > > <!--- set message id for cfmail --->
> > > <cfset messageid = listlast(stobj.emailadresontvanger,"@")>
> > > <cfset messageid = createuuid() & "@" & messageid>
>
> > > <!--- send the email --->
> > > <cfmail type="html"
> > > from="#emailadresverzender.emailadres#"
> > > to="#emailadresontvangerlist#"
> > > subject="#stemailberichten.emailonderwerp# -
> > > ###stemailberichten.objectid#">
> > >        #stemailberichten.emailonderwerp# -
> > > ###stemailberichten.objectid#
> > >                <br />
> > >        <br />
> > >        #replace(stemailberichten.emailtekst,Chr(13),"<br>", "all")
> > > #<br />
> > >        <br />
> > >        <br />
> > >        Vriendelijke groeten,
> > >                <br />
> > >                <br />
> > >                #session.dmprofile.firstname# #session.dmprofile.lastname#.
> > >                <br />
> > >        <br />
> > >        http://#cgi.http_host#<br />
>
> > > <!--- if a file is submitted in the email --->
> > > <cfif arraylen(stemailberichten.aemailbestanden)>
>
> > > <!--- loop over the selected emailbestanden --->
> > > <cfloop index="i" array="#stemailberichten.aemailbestanden#">
>
> > > <!--- get current dmfile item based on current aemailbestanden loop
> > > array item --->
> > > <cfset obj = createObject
> > > ('component',application.stcoapi.dmfile.typePath) />
> > > <cfset emailbestand = obj.getdata(objectid=i) />
>
> > > <!--- set file path --->
> > > <cfset file = "http://www." & listlast
> > > (emailadresverzender.emailadres,"@") & "/
> > > files#emailbestand.filename#">
>
> > > <!--- set cfmailparam with current loop file --->
> > > <cfmailparam file="#file#">
> > > </cfloop>
>
> > > </cfif>
>
> > > <!--- if a image is submitted in the email --->
> > > <cfif arraylen(stemailberichten.aemailafbeeldingen)>
>
> > > <!--- loop over the selected emailafbeeldingen --->
> > > <cfloop index="i" array="#stemailberichten.aemailafbeeldingen#">
>
> > > <!--- get current dmimage item based on current aemailafbeeldingen
> > > loop array item --->
> > > <cfset obj = createObject
> > > ('component',application.stcoapi.dmimage.typePath) />
> > > <cfset emailafbeelding = obj.getdata(objectid=i) />
>
> > > <!--- set image path --->
> > > <cfset file = "http://www." & listlast
> > > (emailadresverzender.emailadres,"@") & emailafbeelding.sourceimage>
>
> > > <!--- set cfmailparam with current loop file --->
> > > <cfmailparam file="#file#">
> > > </cfloop>
>
> > > </cfif>
>
> > > <cfmailparam name="Message-Id" value="<#messageid#>">
> > > <cfmailparam name="Reply-To" value="#emailadresverzender.emailadres#">
> > > <cfmailparam name="MIME-Version" value="1.0">
>
> > > </cfmail>
>
> > > </cfif>
>
> > > </ft:processForm>
>
> > > On Oct 28, 9:04 pm, Tomek Kott <tkott.s...@...> wrote:
> > > > it would probably help if you gave the entire "processForm" tag code,
> > > unless
> > > > the code you gave is the only thing in there.
>
> > > > On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <
>
> > > > marcovandenoe...@...> wrote:
>
> > > > > OK, i have a custom type that uses bSessionOnly="true" so i can set
> > > > > the properties.
> > > > > In the type i can use 2 array related fields, dmfile and dmimage.
>
> > > > > I have only one obj.createData in the "processForm" and the
> > > > > processForm action name is unique to others on the same page...
>
> > > > > Still, when i execute the code i get two db inserts, one is using the
> > > > > properties like i stated in my custom code:
>
> > > > > <!--- write email to db --->
> > > > > <cfset obj = createObject
> > > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > > <cfset stprops = {} />
> > > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > > The other record inserts like it should when you don't use a
> > > > > bSessionOnly="true".
>
> > > > > Any insights, is it because there are related arrays involved???
>
> > > > > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Any insight from a deamon mastermind? Please?

On Oct 28, 9:47 pm, Marco van den Oever <marcovandenoe...@...>
wrote:

> Strange thing is that i only use getdata for the related arrays, so
> that shouldn't create any extra record.
> But it must be the presence of those array fields in the ft:object
> that indeed trigger some stuff.
>
> On Oct 28, 9:43 pm, Marco van den Oever <marcovandenoe...@...>
> wrote:
>
> > When i don't use bSessionOnly and comment out the custom createdata
> > code, i only see one record, so that works.
>
> > When i do use  bSessionOnly, leave the custom createdata code active,
> > comment out all the array related stuff, then only one record is
> > inserted...
>
> > Based on that i assume it's array related...
>
> > On Oct 28, 9:25 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > you're right, it seems that either bSessionOnly is not working, or something
> > > else is going on. I'm trying to remember if for some reason the db saving
> > > has to happen twice because of the arrays or something similar.
>
> > > Have you tried tracing this through? I don't have any clues for you, sorry.
>
> > > On Wed, Oct 28, 2009 at 4:20 PM, Marco van den Oever <
>
> > > marcovandenoe...@...> wrote:
>
> > > > OK here it is:
>
> > > > <ft:processForm action="Verzenden" exit="true">
>
> > > > <ft:processFormObjects typename="emailberichten" bSessionOnly="true" /
>
> > > > <!--- if a emailberichten object was succesfully saved --->
> > > > <cfif len(lSavedObjectIDs)>
>
> > > > <!--- get the emailberichten object data to get other relative data
> > > > that needs to be included --->
> > > > <cfset stemailberichten = getData(objectid=lSavedObjectIDs) />
>
> > > > <!--- get the emailadresverzender emailaddress --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.emailaccounts.typePath) />
> > > > <cfset emailadresverzender = obj.getdata
> > > > (objectid=stemailberichten.aemailaccounts) />
>
> > > > <!--- loop over the selected contactpersonen --->
> > > > <cfloop index="i" array="#stemailberichten.acontactpersonen#">
>
> > > > <!--- set incrementing custom currentrow variable so based on that
> > > > value we can set or don't set some other variables --->
> > > > <cfparam name="currentrow" default="0">
> > > > <cfset currentrow = currentrow + 1>
>
> > > > <!--- get current contactpersonen item based on current
> > > > acontactpersonen loop array item --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.contactpersonen.typePath) />
> > > > <cfset contactpersoon = obj.getdata(objectid=i) />
>
> > > > <!--- set default emailadresontvangerlist variable value to use if one
> > > > emailadresontvanger exists, or as default variable to further build a
> > > > loop building list, only set this variable when currentrow is 1 as it
> > > > is only used when there is only one emailadresontvanger --->
> > > > <cfif currentrow eq "1">
> > > > <cfset emailadresontvangerlist = contactpersoon.emailadres>
> > > > </cfif>
>
> > > > <!--- if there are more then one emailadresontvangers, add them to
> > > > list, only set this variable when currentrow is not 1 as it is only
> > > > used when there are more then one emailadresontvangers, also when used
> > > > in currentrow 1 it would duplicate the previous set
> > > > emailadresontvangerlist variable --->
> > > > <cfif arraylen(stemailberichten.acontactpersonen) gte 2 and currentrow
> > > > neq "1">
> > > > <cfset emailadresontvangerlist = emailadresontvangerlist & "," &
> > > > contactpersoon.emailadres>
> > > > </cfif>
>
> > > > </cfloop>
>
> > > > <!--- write email to db --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > <cfset stprops = {} />
> > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > <!--- set message id for cfmail --->
> > > > <cfset messageid = listlast(stobj.emailadresontvanger,"@")>
> > > > <cfset messageid = createuuid() & "@" & messageid>
>
> > > > <!--- send the email --->
> > > > <cfmail type="html"
> > > > from="#emailadresverzender.emailadres#"
> > > > to="#emailadresontvangerlist#"
> > > > subject="#stemailberichten.emailonderwerp# -
> > > > ###stemailberichten.objectid#">
> > > >        #stemailberichten.emailonderwerp# -
> > > > ###stemailberichten.objectid#
> > > >                <br />
> > > >        <br />
> > > >        #replace(stemailberichten.emailtekst,Chr(13),"<br>", "all")
> > > > #<br />
> > > >        <br />
> > > >        <br />
> > > >        Vriendelijke groeten,
> > > >                <br />
> > > >                <br />
> > > >                #session.dmprofile.firstname# #session.dmprofile.lastname#.
> > > >                <br />
> > > >        <br />
> > > >        http://#cgi.http_host#<br />
>
> > > > <!--- if a file is submitted in the email --->
> > > > <cfif arraylen(stemailberichten.aemailbestanden)>
>
> > > > <!--- loop over the selected emailbestanden --->
> > > > <cfloop index="i" array="#stemailberichten.aemailbestanden#">
>
> > > > <!--- get current dmfile item based on current aemailbestanden loop
> > > > array item --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.dmfile.typePath) />
> > > > <cfset emailbestand = obj.getdata(objectid=i) />
>
> > > > <!--- set file path --->
> > > > <cfset file = "http://www." & listlast
> > > > (emailadresverzender.emailadres,"@") & "/
> > > > files#emailbestand.filename#">
>
> > > > <!--- set cfmailparam with current loop file --->
> > > > <cfmailparam file="#file#">
> > > > </cfloop>
>
> > > > </cfif>
>
> > > > <!--- if a image is submitted in the email --->
> > > > <cfif arraylen(stemailberichten.aemailafbeeldingen)>
>
> > > > <!--- loop over the selected emailafbeeldingen --->
> > > > <cfloop index="i" array="#stemailberichten.aemailafbeeldingen#">
>
> > > > <!--- get current dmimage item based on current aemailafbeeldingen
> > > > loop array item --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.dmimage.typePath) />
> > > > <cfset emailafbeelding = obj.getdata(objectid=i) />
>
> > > > <!--- set image path --->
> > > > <cfset file = "http://www." & listlast
> > > > (emailadresverzender.emailadres,"@") & emailafbeelding.sourceimage>
>
> > > > <!--- set cfmailparam with current loop file --->
> > > > <cfmailparam file="#file#">
> > > > </cfloop>
>
> > > > </cfif>
>
> > > > <cfmailparam name="Message-Id" value="<#messageid#>">
> > > > <cfmailparam name="Reply-To" value="#emailadresverzender.emailadres#">
> > > > <cfmailparam name="MIME-Version" value="1.0">
>
> > > > </cfmail>
>
> > > > </cfif>
>
> > > > </ft:processForm>
>
> > > > On Oct 28, 9:04 pm, Tomek Kott <tkott.s...@...> wrote:
> > > > > it would probably help if you gave the entire "processForm" tag code,
> > > > unless
> > > > > the code you gave is the only thing in there.
>
> > > > > On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <
>
> > > > > marcovandenoe...@...> wrote:
>
> > > > > > OK, i have a custom type that uses bSessionOnly="true" so i can set
> > > > > > the properties.
> > > > > > In the type i can use 2 array related fields, dmfile and dmimage.
>
> > > > > > I have only one obj.createData in the "processForm" and the
> > > > > > processForm action name is unique to others on the same page...
>
> > > > > > Still, when i execute the code i get two db inserts, one is using the
> > > > > > properties like i stated in my custom code:
>
> > > > > > <!--- write email to db --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > > > <cfset stprops = {} />
> > > > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > > > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > > > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > > > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > > > The other record inserts like it should when you don't use a
> > > > > > bSessionOnly="true".
>
> > > > > > Any insights, is it because there are related arrays involved???
>
> > > > > > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Blair McKenzie-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It doesn't ring a bell. I do know that arrays always go in the database. Not sure how that works with bSessionOnly.

Blair

On Thu, Oct 29, 2009 at 12:30 PM, Marco van den Oever <marcovandenoever@...> wrote:

Any insight from a deamon mastermind? Please?

On Oct 28, 9:47 pm, Marco van den Oever <marcovandenoe...@...>
wrote:
> Strange thing is that i only use getdata for the related arrays, so
> that shouldn't create any extra record.
> But it must be the presence of those array fields in the ft:object
> that indeed trigger some stuff.
>
> On Oct 28, 9:43 pm, Marco van den Oever <marcovandenoe...@...>
> wrote:
>
> > When i don't use bSessionOnly and comment out the custom createdata
> > code, i only see one record, so that works.
>
> > When i do use  bSessionOnly, leave the custom createdata code active,
> > comment out all the array related stuff, then only one record is
> > inserted...
>
> > Based on that i assume it's array related...
>
> > On Oct 28, 9:25 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > you're right, it seems that either bSessionOnly is not working, or something
> > > else is going on. I'm trying to remember if for some reason the db saving
> > > has to happen twice because of the arrays or something similar.
>
> > > Have you tried tracing this through? I don't have any clues for you, sorry.
>
> > > On Wed, Oct 28, 2009 at 4:20 PM, Marco van den Oever <
>
> > > marcovandenoe...@...> wrote:
>
> > > > OK here it is:
>
> > > > <ft:processForm action="Verzenden" exit="true">
>
> > > > <ft:processFormObjects typename="emailberichten" bSessionOnly="true" /
>
> > > > <!--- if a emailberichten object was succesfully saved --->
> > > > <cfif len(lSavedObjectIDs)>
>
> > > > <!--- get the emailberichten object data to get other relative data
> > > > that needs to be included --->
> > > > <cfset stemailberichten = getData(objectid=lSavedObjectIDs) />
>
> > > > <!--- get the emailadresverzender emailaddress --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.emailaccounts.typePath) />
> > > > <cfset emailadresverzender = obj.getdata
> > > > (objectid=stemailberichten.aemailaccounts) />
>
> > > > <!--- loop over the selected contactpersonen --->
> > > > <cfloop index="i" array="#stemailberichten.acontactpersonen#">
>
> > > > <!--- set incrementing custom currentrow variable so based on that
> > > > value we can set or don't set some other variables --->
> > > > <cfparam name="currentrow" default="0">
> > > > <cfset currentrow = currentrow + 1>
>
> > > > <!--- get current contactpersonen item based on current
> > > > acontactpersonen loop array item --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.contactpersonen.typePath) />
> > > > <cfset contactpersoon = obj.getdata(objectid=i) />
>
> > > > <!--- set default emailadresontvangerlist variable value to use if one
> > > > emailadresontvanger exists, or as default variable to further build a
> > > > loop building list, only set this variable when currentrow is 1 as it
> > > > is only used when there is only one emailadresontvanger --->
> > > > <cfif currentrow eq "1">
> > > > <cfset emailadresontvangerlist = contactpersoon.emailadres>
> > > > </cfif>
>
> > > > <!--- if there are more then one emailadresontvangers, add them to
> > > > list, only set this variable when currentrow is not 1 as it is only
> > > > used when there are more then one emailadresontvangers, also when used
> > > > in currentrow 1 it would duplicate the previous set
> > > > emailadresontvangerlist variable --->
> > > > <cfif arraylen(stemailberichten.acontactpersonen) gte 2 and currentrow
> > > > neq "1">
> > > > <cfset emailadresontvangerlist = emailadresontvangerlist & "," &
> > > > contactpersoon.emailadres>
> > > > </cfif>
>
> > > > </cfloop>
>
> > > > <!--- write email to db --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > <cfset stprops = {} />
> > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > <!--- set message id for cfmail --->
> > > > <cfset messageid = listlast(stobj.emailadresontvanger,"@")>
> > > > <cfset messageid = createuuid() & "@" & messageid>
>
> > > > <!--- send the email --->
> > > > <cfmail type="html"
> > > > from="#emailadresverzender.emailadres#"
> > > > to="#emailadresontvangerlist#"
> > > > subject="#stemailberichten.emailonderwerp# -
> > > > ###stemailberichten.objectid#">
> > > >        #stemailberichten.emailonderwerp# -
> > > > ###stemailberichten.objectid#
> > > >                <br />
> > > >        <br />
> > > >        #replace(stemailberichten.emailtekst,Chr(13),"<br>", "all")
> > > > #<br />
> > > >        <br />
> > > >        <br />
> > > >        Vriendelijke groeten,
> > > >                <br />
> > > >                <br />
> > > >                #session.dmprofile.firstname# #session.dmprofile.lastname#.
> > > >                <br />
> > > >        <br />
> > > >        http://#cgi.http_host#<br />
>
> > > > <!--- if a file is submitted in the email --->
> > > > <cfif arraylen(stemailberichten.aemailbestanden)>
>
> > > > <!--- loop over the selected emailbestanden --->
> > > > <cfloop index="i" array="#stemailberichten.aemailbestanden#">
>
> > > > <!--- get current dmfile item based on current aemailbestanden loop
> > > > array item --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.dmfile.typePath) />
> > > > <cfset emailbestand = obj.getdata(objectid=i) />
>
> > > > <!--- set file path --->
> > > > <cfset file = "http://www." & listlast
> > > > (emailadresverzender.emailadres,"@") & "/
> > > > files#emailbestand.filename#">
>
> > > > <!--- set cfmailparam with current loop file --->
> > > > <cfmailparam file="#file#">
> > > > </cfloop>
>
> > > > </cfif>
>
> > > > <!--- if a image is submitted in the email --->
> > > > <cfif arraylen(stemailberichten.aemailafbeeldingen)>
>
> > > > <!--- loop over the selected emailafbeeldingen --->
> > > > <cfloop index="i" array="#stemailberichten.aemailafbeeldingen#">
>
> > > > <!--- get current dmimage item based on current aemailafbeeldingen
> > > > loop array item --->
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.dmimage.typePath) />
> > > > <cfset emailafbeelding = obj.getdata(objectid=i) />
>
> > > > <!--- set image path --->
> > > > <cfset file = "http://www." & listlast
> > > > (emailadresverzender.emailadres,"@") & emailafbeelding.sourceimage>
>
> > > > <!--- set cfmailparam with current loop file --->
> > > > <cfmailparam file="#file#">
> > > > </cfloop>
>
> > > > </cfif>
>
> > > > <cfmailparam name="Message-Id" value="<#messageid#>">
> > > > <cfmailparam name="Reply-To" value="#emailadresverzender.emailadres#">
> > > > <cfmailparam name="MIME-Version" value="1.0">
>
> > > > </cfmail>
>
> > > > </cfif>
>
> > > > </ft:processForm>
>
> > > > On Oct 28, 9:04 pm, Tomek Kott <tkott.s...@...> wrote:
> > > > > it would probably help if you gave the entire "processForm" tag code,
> > > > unless
> > > > > the code you gave is the only thing in there.
>
> > > > > On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <
>
> > > > > marcovandenoe...@...> wrote:
>
> > > > > > OK, i have a custom type that uses bSessionOnly="true" so i can set
> > > > > > the properties.
> > > > > > In the type i can use 2 array related fields, dmfile and dmimage.
>
> > > > > > I have only one obj.createData in the "processForm" and the
> > > > > > processForm action name is unique to others on the same page...
>
> > > > > > Still, when i execute the code i get two db inserts, one is using the
> > > > > > properties like i stated in my custom code:
>
> > > > > > <!--- write email to db --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > > > <cfset stprops = {} />
> > > > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > > > <cfset stprops.emailadresverzender = emailadresverzender.emailadres />
> > > > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > > > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > > > The other record inserts like it should when you don't use a
> > > > > > bSessionOnly="true".
>
> > > > > > Any insights, is it because there are related arrays involved???
>
> > > > > > Thanks.



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


mmmm ok, then i'll go and brainstorm on how to avoid this.....

Thanks.

On Oct 29, 2:34 am, Blair McKenzie <shi...@...> wrote:

> It doesn't ring a bell. I do know that arrays always go in the database. Not
> sure how that works with bSessionOnly.
>
> Blair
>
> On Thu, Oct 29, 2009 at 12:30 PM, Marco van den Oever <
>
> marcovandenoe...@...> wrote:
>
> > Any insight from a deamon mastermind? Please?
>
> > On Oct 28, 9:47 pm, Marco van den Oever <marcovandenoe...@...>
> > wrote:
> > > Strange thing is that i only use getdata for the related arrays, so
> > > that shouldn't create any extra record.
> > > But it must be the presence of those array fields in the ft:object
> > > that indeed trigger some stuff.
>
> > > On Oct 28, 9:43 pm, Marco van den Oever <marcovandenoe...@...>
> > > wrote:
>
> > > > When i don't use bSessionOnly and comment out the custom createdata
> > > > code, i only see one record, so that works.
>
> > > > When i do use  bSessionOnly, leave the custom createdata code active,
> > > > comment out all the array related stuff, then only one record is
> > > > inserted...
>
> > > > Based on that i assume it's array related...
>
> > > > On Oct 28, 9:25 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > > > you're right, it seems that either bSessionOnly is not working, or
> > something
> > > > > else is going on. I'm trying to remember if for some reason the db
> > saving
> > > > > has to happen twice because of the arrays or something similar.
>
> > > > > Have you tried tracing this through? I don't have any clues for you,
> > sorry.
>
> > > > > On Wed, Oct 28, 2009 at 4:20 PM, Marco van den Oever <
>
> > > > > marcovandenoe...@...> wrote:
>
> > > > > > OK here it is:
>
> > > > > > <ft:processForm action="Verzenden" exit="true">
>
> > > > > > <ft:processFormObjects typename="emailberichten"
> > bSessionOnly="true" /
>
> > > > > > <!--- if a emailberichten object was succesfully saved --->
> > > > > > <cfif len(lSavedObjectIDs)>
>
> > > > > > <!--- get the emailberichten object data to get other relative data
> > > > > > that needs to be included --->
> > > > > > <cfset stemailberichten = getData(objectid=lSavedObjectIDs) />
>
> > > > > > <!--- get the emailadresverzender emailaddress --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.emailaccounts.typePath) />
> > > > > > <cfset emailadresverzender = obj.getdata
> > > > > > (objectid=stemailberichten.aemailaccounts) />
>
> > > > > > <!--- loop over the selected contactpersonen --->
> > > > > > <cfloop index="i" array="#stemailberichten.acontactpersonen#">
>
> > > > > > <!--- set incrementing custom currentrow variable so based on that
> > > > > > value we can set or don't set some other variables --->
> > > > > > <cfparam name="currentrow" default="0">
> > > > > > <cfset currentrow = currentrow + 1>
>
> > > > > > <!--- get current contactpersonen item based on current
> > > > > > acontactpersonen loop array item --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.contactpersonen.typePath) />
> > > > > > <cfset contactpersoon = obj.getdata(objectid=i) />
>
> > > > > > <!--- set default emailadresontvangerlist variable value to use if
> > one
> > > > > > emailadresontvanger exists, or as default variable to further build
> > a
> > > > > > loop building list, only set this variable when currentrow is 1 as
> > it
> > > > > > is only used when there is only one emailadresontvanger --->
> > > > > > <cfif currentrow eq "1">
> > > > > > <cfset emailadresontvangerlist = contactpersoon.emailadres>
> > > > > > </cfif>
>
> > > > > > <!--- if there are more then one emailadresontvangers, add them to
> > > > > > list, only set this variable when currentrow is not 1 as it is only
> > > > > > used when there are more then one emailadresontvangers, also when
> > used
> > > > > > in currentrow 1 it would duplicate the previous set
> > > > > > emailadresontvangerlist variable --->
> > > > > > <cfif arraylen(stemailberichten.acontactpersonen) gte 2 and
> > currentrow
> > > > > > neq "1">
> > > > > > <cfset emailadresontvangerlist = emailadresontvangerlist & "," &
> > > > > > contactpersoon.emailadres>
> > > > > > </cfif>
>
> > > > > > </cfloop>
>
> > > > > > <!--- write email to db --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > > > <cfset stprops = {} />
> > > > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > > > <cfset stprops.emailadresverzender = emailadresverzender.emailadres
> > />
> > > > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > > > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > > > <!--- set message id for cfmail --->
> > > > > > <cfset messageid = listlast(stobj.emailadresontvanger,"@")>
> > > > > > <cfset messageid = createuuid() & "@" & messageid>
>
> > > > > > <!--- send the email --->
> > > > > > <cfmail type="html"
> > > > > > from="#emailadresverzender.emailadres#"
> > > > > > to="#emailadresontvangerlist#"
> > > > > > subject="#stemailberichten.emailonderwerp# -
> > > > > > ###stemailberichten.objectid#">
> > > > > >        #stemailberichten.emailonderwerp# -
> > > > > > ###stemailberichten.objectid#
> > > > > >                <br />
> > > > > >        <br />
> > > > > >        #replace(stemailberichten.emailtekst,Chr(13),"<br>", "all")
> > > > > > #<br />
> > > > > >        <br />
> > > > > >        <br />
> > > > > >        Vriendelijke groeten,
> > > > > >                <br />
> > > > > >                <br />
> > > > > >                #session.dmprofile.firstname#
> > #session.dmprofile.lastname#.
> > > > > >                <br />
> > > > > >        <br />
> > > > > >        http://#cgi.http_host#<br />
>
> > > > > > <!--- if a file is submitted in the email --->
> > > > > > <cfif arraylen(stemailberichten.aemailbestanden)>
>
> > > > > > <!--- loop over the selected emailbestanden --->
> > > > > > <cfloop index="i" array="#stemailberichten.aemailbestanden#">
>
> > > > > > <!--- get current dmfile item based on current aemailbestanden loop
> > > > > > array item --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.dmfile.typePath) />
> > > > > > <cfset emailbestand = obj.getdata(objectid=i) />
>
> > > > > > <!--- set file path --->
> > > > > > <cfset file = "http://www." & listlast
> > > > > > (emailadresverzender.emailadres,"@") & "/
> > > > > > files#emailbestand.filename#">
>
> > > > > > <!--- set cfmailparam with current loop file --->
> > > > > > <cfmailparam file="#file#">
> > > > > > </cfloop>
>
> > > > > > </cfif>
>
> > > > > > <!--- if a image is submitted in the email --->
> > > > > > <cfif arraylen(stemailberichten.aemailafbeeldingen)>
>
> > > > > > <!--- loop over the selected emailafbeeldingen --->
> > > > > > <cfloop index="i" array="#stemailberichten.aemailafbeeldingen#">
>
> > > > > > <!--- get current dmimage item based on current aemailafbeeldingen
> > > > > > loop array item --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.dmimage.typePath) />
> > > > > > <cfset emailafbeelding = obj.getdata(objectid=i) />
>
> > > > > > <!--- set image path --->
> > > > > > <cfset file = "http://www." & listlast
> > > > > > (emailadresverzender.emailadres,"@") & emailafbeelding.sourceimage>
>
> > > > > > <!--- set cfmailparam with current loop file --->
> > > > > > <cfmailparam file="#file#">
> > > > > > </cfloop>
>
> > > > > > </cfif>
>
> > > > > > <cfmailparam name="Message-Id" value="<#messageid#>">
> > > > > > <cfmailparam name="Reply-To"
> > value="#emailadresverzender.emailadres#">
> > > > > > <cfmailparam name="MIME-Version" value="1.0">
>
> > > > > > </cfmail>
>
> > > > > > </cfif>
>
> > > > > > </ft:processForm>
>
> > > > > > On Oct 28, 9:04 pm, Tomek Kott <tkott.s...@...> wrote:
> > > > > > > it would probably help if you gave the entire "processForm" tag
> > code,
> > > > > > unless
> > > > > > > the code you gave is the only thing in there.
>
> > > > > > > On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <
>
> > > > > > > marcovandenoe...@...> wrote:
>
> > > > > > > > OK, i have a custom type that uses bSessionOnly="true" so i can
> > set
> > > > > > > > the properties.
> > > > > > > > In the type i can use 2 array related fields, dmfile and
> > dmimage.
>
> > > > > > > > I have only one obj.createData in the "processForm" and the
> > > > > > > > processForm action name is unique to others on the same page...
>
> > > > > > > > Still, when i execute the code i get two db inserts, one is
> > using the
> > > > > > > > properties like i stated in my custom code:
>
> > > > > > > > <!--- write email to db --->
> > > > > > > > <cfset obj = createObject
> > > > > > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > > > > > <cfset stprops = {} />
> > > > > > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > > > > > <cfset stprops.emailadresverzender =
> > emailadresverzender.emailadres />
> > > > > > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp
> > />
> > > > > > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > > > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > > > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > > > > > The other record inserts like it should when you don't use a
> > > > > > > > bSessionOnly="true".
>
> > > > > > > > Any insights, is it because there are related arrays
> > involved???
>
> > > > > > > > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by joel.cass :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I smell wddx packets...

On Thu, Oct 29, 2009 at 12:45 PM, Marco van den Oever <marcovandenoever@...> wrote:

mmmm ok, then i'll go and brainstorm on how to avoid this.....

Thanks.

On Oct 29, 2:34 am, Blair McKenzie <shi...@...> wrote:
> It doesn't ring a bell. I do know that arrays always go in the database. Not
> sure how that works with bSessionOnly.
>
> Blair
>
> On Thu, Oct 29, 2009 at 12:30 PM, Marco van den Oever <
>
> marcovandenoe...@...> wrote:
>
> > Any insight from a deamon mastermind? Please?
>
> > On Oct 28, 9:47 pm, Marco van den Oever <marcovandenoe...@...>
> > wrote:
> > > Strange thing is that i only use getdata for the related arrays, so
> > > that shouldn't create any extra record.
> > > But it must be the presence of those array fields in the ft:object
> > > that indeed trigger some stuff.
>
> > > On Oct 28, 9:43 pm, Marco van den Oever <marcovandenoe...@...>
> > > wrote:
>
> > > > When i don't use bSessionOnly and comment out the custom createdata
> > > > code, i only see one record, so that works.
>
> > > > When i do use  bSessionOnly, leave the custom createdata code active,
> > > > comment out all the array related stuff, then only one record is
> > > > inserted...
>
> > > > Based on that i assume it's array related...
>
> > > > On Oct 28, 9:25 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > > > you're right, it seems that either bSessionOnly is not working, or
> > something
> > > > > else is going on. I'm trying to remember if for some reason the db
> > saving
> > > > > has to happen twice because of the arrays or something similar.
>
> > > > > Have you tried tracing this through? I don't have any clues for you,
> > sorry.
>
> > > > > On Wed, Oct 28, 2009 at 4:20 PM, Marco van den Oever <
>
> > > > > marcovandenoe...@...> wrote:
>
> > > > > > OK here it is:
>
> > > > > > <ft:processForm action="Verzenden" exit="true">
>
> > > > > > <ft:processFormObjects typename="emailberichten"
> > bSessionOnly="true" /
>
> > > > > > <!--- if a emailberichten object was succesfully saved --->
> > > > > > <cfif len(lSavedObjectIDs)>
>
> > > > > > <!--- get the emailberichten object data to get other relative data
> > > > > > that needs to be included --->
> > > > > > <cfset stemailberichten = getData(objectid=lSavedObjectIDs) />
>
> > > > > > <!--- get the emailadresverzender emailaddress --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.emailaccounts.typePath) />
> > > > > > <cfset emailadresverzender = obj.getdata
> > > > > > (objectid=stemailberichten.aemailaccounts) />
>
> > > > > > <!--- loop over the selected contactpersonen --->
> > > > > > <cfloop index="i" array="#stemailberichten.acontactpersonen#">
>
> > > > > > <!--- set incrementing custom currentrow variable so based on that
> > > > > > value we can set or don't set some other variables --->
> > > > > > <cfparam name="currentrow" default="0">
> > > > > > <cfset currentrow = currentrow + 1>
>
> > > > > > <!--- get current contactpersonen item based on current
> > > > > > acontactpersonen loop array item --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.contactpersonen.typePath) />
> > > > > > <cfset contactpersoon = obj.getdata(objectid=i) />
>
> > > > > > <!--- set default emailadresontvangerlist variable value to use if
> > one
> > > > > > emailadresontvanger exists, or as default variable to further build
> > a
> > > > > > loop building list, only set this variable when currentrow is 1 as
> > it
> > > > > > is only used when there is only one emailadresontvanger --->
> > > > > > <cfif currentrow eq "1">
> > > > > > <cfset emailadresontvangerlist = contactpersoon.emailadres>
> > > > > > </cfif>
>
> > > > > > <!--- if there are more then one emailadresontvangers, add them to
> > > > > > list, only set this variable when currentrow is not 1 as it is only
> > > > > > used when there are more then one emailadresontvangers, also when
> > used
> > > > > > in currentrow 1 it would duplicate the previous set
> > > > > > emailadresontvangerlist variable --->
> > > > > > <cfif arraylen(stemailberichten.acontactpersonen) gte 2 and
> > currentrow
> > > > > > neq "1">
> > > > > > <cfset emailadresontvangerlist = emailadresontvangerlist & "," &
> > > > > > contactpersoon.emailadres>
> > > > > > </cfif>
>
> > > > > > </cfloop>
>
> > > > > > <!--- write email to db --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > > > <cfset stprops = {} />
> > > > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > > > <cfset stprops.emailadresverzender = emailadresverzender.emailadres
> > />
> > > > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp />
> > > > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > > > <!--- set message id for cfmail --->
> > > > > > <cfset messageid = listlast(stobj.emailadresontvanger,"@")>
> > > > > > <cfset messageid = createuuid() & "@" & messageid>
>
> > > > > > <!--- send the email --->
> > > > > > <cfmail type="html"
> > > > > > from="#emailadresverzender.emailadres#"
> > > > > > to="#emailadresontvangerlist#"
> > > > > > subject="#stemailberichten.emailonderwerp# -
> > > > > > ###stemailberichten.objectid#">
> > > > > >        #stemailberichten.emailonderwerp# -
> > > > > > ###stemailberichten.objectid#
> > > > > >                <br />
> > > > > >        <br />
> > > > > >        #replace(stemailberichten.emailtekst,Chr(13),"<br>", "all")
> > > > > > #<br />
> > > > > >        <br />
> > > > > >        <br />
> > > > > >        Vriendelijke groeten,
> > > > > >                <br />
> > > > > >                <br />
> > > > > >                #session.dmprofile.firstname#
> > #session.dmprofile.lastname#.
> > > > > >                <br />
> > > > > >        <br />
> > > > > >        http://#cgi.http_host#<br />
>
> > > > > > <!--- if a file is submitted in the email --->
> > > > > > <cfif arraylen(stemailberichten.aemailbestanden)>
>
> > > > > > <!--- loop over the selected emailbestanden --->
> > > > > > <cfloop index="i" array="#stemailberichten.aemailbestanden#">
>
> > > > > > <!--- get current dmfile item based on current aemailbestanden loop
> > > > > > array item --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.dmfile.typePath) />
> > > > > > <cfset emailbestand = obj.getdata(objectid=i) />
>
> > > > > > <!--- set file path --->
> > > > > > <cfset file = "http://www." & listlast
> > > > > > (emailadresverzender.emailadres,"@") & "/
> > > > > > files#emailbestand.filename#">
>
> > > > > > <!--- set cfmailparam with current loop file --->
> > > > > > <cfmailparam file="#file#">
> > > > > > </cfloop>
>
> > > > > > </cfif>
>
> > > > > > <!--- if a image is submitted in the email --->
> > > > > > <cfif arraylen(stemailberichten.aemailafbeeldingen)>
>
> > > > > > <!--- loop over the selected emailafbeeldingen --->
> > > > > > <cfloop index="i" array="#stemailberichten.aemailafbeeldingen#">
>
> > > > > > <!--- get current dmimage item based on current aemailafbeeldingen
> > > > > > loop array item --->
> > > > > > <cfset obj = createObject
> > > > > > ('component',application.stcoapi.dmimage.typePath) />
> > > > > > <cfset emailafbeelding = obj.getdata(objectid=i) />
>
> > > > > > <!--- set image path --->
> > > > > > <cfset file = "http://www." & listlast
> > > > > > (emailadresverzender.emailadres,"@") & emailafbeelding.sourceimage>
>
> > > > > > <!--- set cfmailparam with current loop file --->
> > > > > > <cfmailparam file="#file#">
> > > > > > </cfloop>
>
> > > > > > </cfif>
>
> > > > > > <cfmailparam name="Message-Id" value="<#messageid#>">
> > > > > > <cfmailparam name="Reply-To"
> > value="#emailadresverzender.emailadres#">
> > > > > > <cfmailparam name="MIME-Version" value="1.0">
>
> > > > > > </cfmail>
>
> > > > > > </cfif>
>
> > > > > > </ft:processForm>
>
> > > > > > On Oct 28, 9:04 pm, Tomek Kott <tkott.s...@...> wrote:
> > > > > > > it would probably help if you gave the entire "processForm" tag
> > code,
> > > > > > unless
> > > > > > > the code you gave is the only thing in there.
>
> > > > > > > On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <
>
> > > > > > > marcovandenoe...@...> wrote:
>
> > > > > > > > OK, i have a custom type that uses bSessionOnly="true" so i can
> > set
> > > > > > > > the properties.
> > > > > > > > In the type i can use 2 array related fields, dmfile and
> > dmimage.
>
> > > > > > > > I have only one obj.createData in the "processForm" and the
> > > > > > > > processForm action name is unique to others on the same page...
>
> > > > > > > > Still, when i execute the code i get two db inserts, one is
> > using the
> > > > > > > > properties like i stated in my custom code:
>
> > > > > > > > <!--- write email to db --->
> > > > > > > > <cfset obj = createObject
> > > > > > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > > > > > <cfset stprops = {} />
> > > > > > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > > > > > <cfset stprops.emailadresverzender =
> > emailadresverzender.emailadres />
> > > > > > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp
> > />
> > > > > > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > > > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > > > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > > > > > The other record inserts like it should when you don't use a
> > > > > > > > bSessionOnly="true".
>
> > > > > > > > Any insights, is it because there are related arrays
> > involved???
>
> > > > > > > > Thanks.



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


euhmmm... my nose must be full of questionmarks as i don't smell it,
can you clarify?

thanks

On Oct 29, 4:31 am, Joel Cass <joel.a.c...@...> wrote:

> I smell wddx packets...
>
> On Thu, Oct 29, 2009 at 12:45 PM, Marco van den Oever <
>
> marcovandenoe...@...> wrote:
>
> > mmmm ok, then i'll go and brainstorm on how to avoid this.....
>
> > Thanks.
>
> > On Oct 29, 2:34 am, Blair McKenzie <shi...@...> wrote:
> > > It doesn't ring a bell. I do know that arrays always go in the database.
> > Not
> > > sure how that works with bSessionOnly.
>
> > > Blair
>
> > > On Thu, Oct 29, 2009 at 12:30 PM, Marco van den Oever <
>
> > > marcovandenoe...@...> wrote:
>
> > > > Any insight from a deamon mastermind? Please?
>
> > > > On Oct 28, 9:47 pm, Marco van den Oever <marcovandenoe...@...>
> > > > wrote:
> > > > > Strange thing is that i only use getdata for the related arrays, so
> > > > > that shouldn't create any extra record.
> > > > > But it must be the presence of those array fields in the ft:object
> > > > > that indeed trigger some stuff.
>
> > > > > On Oct 28, 9:43 pm, Marco van den Oever <marcovandenoe...@...>
> > > > > wrote:
>
> > > > > > When i don't use bSessionOnly and comment out the custom createdata
> > > > > > code, i only see one record, so that works.
>
> > > > > > When i do use  bSessionOnly, leave the custom createdata code
> > active,
> > > > > > comment out all the array related stuff, then only one record is
> > > > > > inserted...
>
> > > > > > Based on that i assume it's array related...
>
> > > > > > On Oct 28, 9:25 pm, Tomek Kott <tkott.s...@...> wrote:
>
> > > > > > > you're right, it seems that either bSessionOnly is not working,
> > or
> > > > something
> > > > > > > else is going on. I'm trying to remember if for some reason the
> > db
> > > > saving
> > > > > > > has to happen twice because of the arrays or something similar.
>
> > > > > > > Have you tried tracing this through? I don't have any clues for
> > you,
> > > > sorry.
>
> > > > > > > On Wed, Oct 28, 2009 at 4:20 PM, Marco van den Oever <
>
> > > > > > > marcovandenoe...@...> wrote:
>
> > > > > > > > OK here it is:
>
> > > > > > > > <ft:processForm action="Verzenden" exit="true">
>
> > > > > > > > <ft:processFormObjects typename="emailberichten"
> > > > bSessionOnly="true" /
>
> > > > > > > > <!--- if a emailberichten object was succesfully saved --->
> > > > > > > > <cfif len(lSavedObjectIDs)>
>
> > > > > > > > <!--- get the emailberichten object data to get other relative
> > data
> > > > > > > > that needs to be included --->
> > > > > > > > <cfset stemailberichten = getData(objectid=lSavedObjectIDs) />
>
> > > > > > > > <!--- get the emailadresverzender emailaddress --->
> > > > > > > > <cfset obj = createObject
> > > > > > > > ('component',application.stcoapi.emailaccounts.typePath) />
> > > > > > > > <cfset emailadresverzender = obj.getdata
> > > > > > > > (objectid=stemailberichten.aemailaccounts) />
>
> > > > > > > > <!--- loop over the selected contactpersonen --->
> > > > > > > > <cfloop index="i" array="#stemailberichten.acontactpersonen#">
>
> > > > > > > > <!--- set incrementing custom currentrow variable so based on
> > that
> > > > > > > > value we can set or don't set some other variables --->
> > > > > > > > <cfparam name="currentrow" default="0">
> > > > > > > > <cfset currentrow = currentrow + 1>
>
> > > > > > > > <!--- get current contactpersonen item based on current
> > > > > > > > acontactpersonen loop array item --->
> > > > > > > > <cfset obj = createObject
> > > > > > > > ('component',application.stcoapi.contactpersonen.typePath) />
> > > > > > > > <cfset contactpersoon = obj.getdata(objectid=i) />
>
> > > > > > > > <!--- set default emailadresontvangerlist variable value to use
> > if
> > > > one
> > > > > > > > emailadresontvanger exists, or as default variable to further
> > build
> > > > a
> > > > > > > > loop building list, only set this variable when currentrow is 1
> > as
> > > > it
> > > > > > > > is only used when there is only one emailadresontvanger --->
> > > > > > > > <cfif currentrow eq "1">
> > > > > > > > <cfset emailadresontvangerlist = contactpersoon.emailadres>
> > > > > > > > </cfif>
>
> > > > > > > > <!--- if there are more then one emailadresontvangers, add them
> > to
> > > > > > > > list, only set this variable when currentrow is not 1 as it is
> > only
> > > > > > > > used when there are more then one emailadresontvangers, also
> > when
> > > > used
> > > > > > > > in currentrow 1 it would duplicate the previous set
> > > > > > > > emailadresontvangerlist variable --->
> > > > > > > > <cfif arraylen(stemailberichten.acontactpersonen) gte 2 and
> > > > currentrow
> > > > > > > > neq "1">
> > > > > > > > <cfset emailadresontvangerlist = emailadresontvangerlist & ","
> > &
> > > > > > > > contactpersoon.emailadres>
> > > > > > > > </cfif>
>
> > > > > > > > </cfloop>
>
> > > > > > > > <!--- write email to db --->
> > > > > > > > <cfset obj = createObject
> > > > > > > > ('component',application.stcoapi.emailberichten.typePath) />
> > > > > > > > <cfset stprops = {} />
> > > > > > > > <cfset stprops.emailadresontvanger = emailadresontvangerlist />
> > > > > > > > <cfset stprops.emailadresverzender =
> > emailadresverzender.emailadres
> > > > />
> > > > > > > > <cfset stprops.emailonderwerp = stemailberichten.emailonderwerp
> > />
> > > > > > > > <cfset stprops.emailtekst = stemailberichten.emailtekst />
> > > > > > > > <cfset stprops.label = stemailberichten.emailonderwerp />
> > > > > > > > <cfset obj.createData(stProperties=stprops) />
>
> > > > > > > > <!--- set message id for cfmail --->
> > > > > > > > <cfset messageid = listlast(stobj.emailadresontvanger,"@")>
> > > > > > > > <cfset messageid = createuuid() & "@" & messageid>
>
> > > > > > > > <!--- send the email --->
> > > > > > > > <cfmail type="html"
> > > > > > > > from="#emailadresverzender.emailadres#"
> > > > > > > > to="#emailadresontvangerlist#"
> > > > > > > > subject="#stemailberichten.emailonderwerp# -
> > > > > > > > ###stemailberichten.objectid#">
> > > > > > > >        #stemailberichten.emailonderwerp# -
> > > > > > > > ###stemailberichten.objectid#
> > > > > > > >                <br />
> > > > > > > >        <br />
> > > > > > > >        #replace(stemailberichten.emailtekst,Chr(13),"<br>",
> > "all")
> > > > > > > > #<br />
> > > > > > > >        <br />
> > > > > > > >        <br />
> > > > > > > >        Vriendelijke groeten,
> > > > > > > >                <br />
> > > > > > > >                <br />
> > > > > > > >                #session.dmprofile.firstname#
> > > > #session.dmprofile.lastname#.
> > > > > > > >                <br />
> > > > > > > >        <br />
> > > > > > > >        http://#cgi.http_host#<br />
>
> > > > > > > > <!--- if a file is submitted in the email --->
> > > > > > > > <cfif arraylen(stemailberichten.aemailbestanden)>
>
> > > > > > > > <!--- loop over the selected emailbestanden --->
> > > > > > > > <cfloop index="i" array="#stemailberichten.aemailbestanden#">
>
> > > > > > > > <!--- get current dmfile item based on current aemailbestanden
> > loop
> > > > > > > > array item --->
> > > > > > > > <cfset obj = createObject
> > > > > > > > ('component',application.stcoapi.dmfile.typePath) />
> > > > > > > > <cfset emailbestand = obj.getdata(objectid=i) />
>
> > > > > > > > <!--- set file path --->
> > > > > > > > <cfset file = "http://www." & listlast
> > > > > > > > (emailadresverzender.emailadres,"@") & "/
> > > > > > > > files#emailbestand.filename#">
>
> > > > > > > > <!--- set cfmailparam with current loop file --->
> > > > > > > > <cfmailparam file="#file#">
> > > > > > > > </cfloop>
>
> > > > > > > > </cfif>
>
> > > > > > > > <!--- if a image is submitted in the email --->
> > > > > > > > <cfif arraylen(stemailberichten.aemailafbeeldingen)>
>
> > > > > > > > <!--- loop over the selected emailafbeeldingen --->
> > > > > > > > <cfloop index="i"
> > array="#stemailberichten.aemailafbeeldingen#">
>
> > > > > > > > <!--- get current dmimage item based on current
> > aemailafbeeldingen
> > > > > > > > loop array item --->
> > > > > > > > <cfset obj = createObject
> > > > > > > > ('component',application.stcoapi.dmimage.typePath) />
> > > > > > > > <cfset emailafbeelding = obj.getdata(objectid=i) />
>
> > > > > > > > <!--- set image path --->
> > > > > > > > <cfset file = "http://www." & listlast
> > > > > > > > (emailadresverzender.emailadres,"@") &
> > emailafbeelding.sourceimage>
>
> > > > > > > > <!--- set cfmailparam with current loop file --->
> > > > > > > > <cfmailparam file="#file#">
> > > > > > > > </cfloop>
>
> > > > > > > > </cfif>
>
> > > > > > > > <cfmailparam name="Message-Id" value="<#messageid#>">
> > > > > > > > <cfmailparam name="Reply-To"
> > > > value="#emailadresverzender.emailadres#">
> > > > > > > > <cfmailparam name="MIME-Version" value="1.0">
>
> > > > > > > > </cfmail>
>
> > > > > > > > </cfif>
>
> > > > > > > > </ft:processForm>
>
> > > > > > > > On Oct 28, 9:04 pm, Tomek Kott <tkott.s...@...> wrote:
> > > > > > > > > it would probably help if you gave the entire "processForm"
> > tag
> > > > code,
> > > > > > > > unless
> > > > > > > > > the code you gave is the only thing in there.
>
> > > > > > > > > On Wed, Oct 28, 2009 at 2:54 PM, Marco van den Oever <
>
> > > > > > > > > marcovandenoe...@...> wrote:
>
> > > > > > > > > > OK, i have a custom type that uses bSessionOnly="true" so i
> > can
> > > > set
> > > > > > > > > > the properties.
> > > > > > > > > > In the type i can use 2 array related fields, dmfile and
> > > > dmimage.
>
> > > > > > > > > > I have only one obj.createData in the "processForm" and the
> > > > > > > > > > processForm action name is unique to others on the same
> > page...
>
> > > > > > > > > > Still, when i execute the code i get two db inserts, one is
> > > > using the
> > > > > > > > > > properties like i stated in my custom code:
>
> > > > > > > > > > <!--- write email to db --->
> > > > > > > > > > <cfset obj = createObject
> > > > > > > > > > ('component',application.stcoapi.emailberichten.typePath)
> > />
> > > > > > > > > > <cfset stprops = {} />
>
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by modius :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 29, 7:47 am, Marco van den Oever <marcovandenoe...@...>
wrote:
> Strange thing is that i only use getdata for the related arrays, so
> that shouldn't create any extra record.
> But it must be the presence of those array fields in the ft:object
> that indeed trigger some stuff.

Without delving into the bowels of fourQ...

I believe that array relationships cannot be temporary -- when you
make a reference in an array it is immediate for that objectid.  In
the case of an object being held only in session, ie. has no
persistence in the data model, the framework automatically commits the
object (if possible) and then sets up the array reference.

This is why you cannot have array references in "form types"; form
types are basically content types without persistence and are built
in ./packages/forms.  For example, in the case of config items.

Hope that helps,

-- geoff
http://www.daemon.com.au/
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by joel.cass :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Re: wddx packets...

Yeah I was just thinking that a new type[/formtool?] could be created that stores relationship data as a wddx packet in a field somewhere. Not as useful as the relational database concept but would allow you to relate objects without saving to the db

Joel

On Fri, Oct 30, 2009 at 9:07 AM, modius <modius@...> wrote:

On Oct 29, 7:47 am, Marco van den Oever <marcovandenoe...@...>
wrote:
> Strange thing is that i only use getdata for the related arrays, so
> that shouldn't create any extra record.
> But it must be the presence of those array fields in the ft:object
> that indeed trigger some stuff.

Without delving into the bowels of fourQ...

I believe that array relationships cannot be temporary -- when you
make a reference in an array it is immediate for that objectid.  In
the case of an object being held only in session, ie. has no
persistence in the data model, the framework automatically commits the
object (if possible) and then sets up the array reference.

This is why you cannot have array references in "form types"; form
types are basically content types without persistence and are built
in ./packages/forms.  For example, in the case of config items.

Hope that helps,

-- geoff
http://www.daemon.com.au/



--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---


Re: Multiple inserts while using bSessionOnly="true" with related arrays

by Marco van den Oever :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I believe i solved it by changing the "createdata" to "setdata",
thereby just update the already set db record with the values i
wanted...

On Oct 30, 12:25 am, Joel Cass <joel.a.c...@...> wrote:

> Re: wddx packets...
>
> Yeah I was just thinking that a new type[/formtool?] could be created that
> stores relationship data as a wddx packet in a field somewhere. Not as
> useful as the relational database concept but would allow you to relate
> objects without saving to the db
>
> Joel
>
> On Fri, Oct 30, 2009 at 9:07 AM, modius <mod...@...> wrote:
>
> > On Oct 29, 7:47 am, Marco van den Oever <marcovandenoe...@...>
> > wrote:
> > > Strange thing is that i only use getdata for the related arrays, so
> > > that shouldn't create any extra record.
> > > But it must be the presence of those array fields in the ft:object
> > > that indeed trigger some stuff.
>
> > Without delving into the bowels of fourQ...
>
> > I believe that array relationships cannot be temporary -- when you
> > make a reference in an array it is immediate for that objectid.  In
> > the case of an object being held only in session, ie. has no
> > persistence in the data model, the framework automatically commits the
> > object (if possible) and then sets up the array reference.
>
> > This is why you cannot have array references in "form types"; form
> > types are basically content types without persistence and are built
> > in ./packages/forms.  For example, in the case of config items.
>
> > Hope that helps,
>
> > -- geoff
> >http://www.daemon.com.au/
--~--~---------~--~----~------------~-------~--~----~
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcry-dev@...
To unsubscribe, email: farcry-dev+unsubscribe@...
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry
-~----------~----~----~----~------~----~------~--~---