No problem, i didn't know either about the lSavedObjectIDs, but it's
very handy :)
It basically works now and i could use a far more easier code so
that's already very nice.
Thanks
On Dec 1, 5:29 pm, "Tomek Kott" <[EMAIL PROTECTED]> wrote:
> sorry, i have no idea now, I didn't even know that there was such a thing as
> lSavedObjectIDs....
> good luck,
>
> Tomek
>
> On Mon, Dec 1, 2008 at 11:10 AM, Marco van den Oever <
>
> [EMAIL PROTECTED]> wrote:
>
> > Tried that already and then:
>
> > <cfdump var="#lSavedObjectIDs#">
> > <cfabort>
>
> > Do i need to cfdump it in a different way?
>
> > But just 1 objectid, a new one, so generated for the new ticketanswers
> > objectid.
>
> > Does it might have to do with the way i setup the ticket object,
> > divided into 3 parts?:
>
> > <ft:object typename="tickets" objectid="#stobj.objectid#"
> > lFields="department,subject,errorurl,description" r_stPrefix="prefix"
> > legend="General Details" />
>
> > <ft:object typename="tickets" objectid="#stobj.objectid#"
> > lFields="priority" r_stPrefix="prefix" legend="Priority" />
>
> > <ft:object typename="tickets" objectid="#stobj.objectid#"
> > lFields="notification" r_stPrefix="prefix" legend="Notification" />
>
> > Thanks
>
> > On Dec 1, 4:19 pm, "Tomek Kott" <[EMAIL PROTECTED]> wrote:
> > > Hmm, what if you do bSessionOnly on both the process form objects calls?
>
> > > On Mon, Dec 1, 2008 at 10:17 AM, Marco van den Oever <
>
> > > [EMAIL PROTECTED]> wrote:
>
> > > > As the ticket already exist i thought now i only could use the method
> > > > like you described for the ticketanswer object.
>
> > > > To be honoust, when i do a cfdump lSavedObjectIDs, i only see the new
> > > > generated objectid of the ticketanswers object, i don't see two
> > > > objectid's (one of tickets object and one of ticketanswers object). Or
> > > > am i missing something?
>
> > > > So how can i check for both? For now this is working, and with less
> > > > complicated code! but it might not do 100% of what you meant.
>
> > > > I created it like:
>
> > > > <ft:processForm action="Save">
>
> > > > <ft:processFormObjects typename="tickets" />
>
> > > > <ft:processformobjects typename="ticketanswers" bSessionOnly="true" />
>
> > > > <cfif isdefined('lSavedObjectIDs')>
>
> > > > <cfset formprefix = replace(lSavedObjectIDs,'-','','ALL') />
>
> > > > <cfif form[formprefix & 'answer'] gt 0>
>
> > > > <cfset obj = createObject
> > > > ('component',application.stcoapi.ticketanswers.typePath) />
> > > > <cfset stprops = {} />
> > > > <cfset stprops.objectid = lSavedObjectIDs />
> > > > <cfset stprops.ticketobjectid = stobj.objectid />
> > > > <cfset stprops.answer = form[formprefix & 'answer'] />
> > > > <cfset obj.setData(stProperties=stprops) />
>
> > > > </cfif>
>
> > > > </cfif>
>
> > > > </ft:processForm>
>
> > > > And the ticketanswers object without a given objectid so a new one is
> > > > created as default and as prefix for the submitted form field:
>
> > > > <ft:object typename="ticketanswers" lFields="answer"
> > > > r_stPrefix="prefix" legend="Answer" />
>
> > > > Thanks very much
>
> > > > On Dec 1, 3:51 am, Marco van den Oever <[EMAIL PROTECTED]>
> > > > wrote:
> > > > > Awesome, just wanted to know for sure, thanks!
>
> > > > > On Dec 1, 3:15 am, "Blair McKenzie" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Use bSessionOnly to stop them from being saved to the database,
> > make
> > > > the
> > > > > > changes you need (e.g. setting a uuid property on one), then use
> > > > setData to
> > > > > > write the objects to the database.
>
> > > > > > On Mon, Dec 1, 2008 at 12:41 PM, Marco van den Oever <
>
> > > > > > [EMAIL PROTECTED]> wrote:
>
> > > > > > > Good to know! Based on the fact you gave the example of using
> > > > > > > lSavedObjectIDs as response to the code i showed, you advice me
> > to
> > > > > > > adjust my code to a usage with lSavedObjectIDs?
>
> > > > > > > As my mind runs over it i get stuck at the point i submit the
> > both
> > > > > > > objects at the same time , so therefore the 'after save'
> > > > > > > lSavedObjectIDs can't be used, would you advice me to change the
> > code
> > > > > > > so that it can use this method?
>
> > > > > > > On Dec 1, 1:57 am, "Blair McKenzie" <[EMAIL PROTECTED]> wrote:
> > > > > > > > I would usually put basic save actions in one of the save
> > functions
> > > > -
> > > > > > > > beforeSave, setData, or afterSave, depending on what I want to
> > do.
>
> > > > > > > > I use lSavedObjectIDs mainly for when I need to create
> > secondary
> > > > objects
> > > > > > > > that are dependant on another.
>
> > > > > > > > Another situation that can come up is when you are creating two
> > > > that are
> > > > > > > > co-dependant - for example if both objects should fail if
> > either
> > > > one has
> > > > > > > an
> > > > > > > > error, or if they both have references to each other. In that
> > case
> > > > I put
> > > > > > > > bSessionOnly="true" (saves the object just for the session) on
> > > > > > > > ft:processformobjects and retrieve the new object with
> > > > lSavedObjectIDs.
> > > > > > > Then
> > > > > > > > at the end of the ft:processformobjects if there are no
> > problems,
> > > > use
> > > > > > > > setData to resave the objects to the database.
>
> > > > > > > > On Mon, Dec 1, 2008 at 11:47 AM, Marco van den Oever <
>
> > > > > > > > [EMAIL PROTECTED]> wrote:
>
> > > > > > > > > That is interesting, so you could use that for after save
> > actions
> > > > > > > > > mostly?
>
> > > > > > > > > On Dec 1, 1:31 am, "Blair McKenzie" <[EMAIL PROTECTED]>
> > wrote:
> > > > > > > > > > When ft:processformobjects finishes saving an object it
> > adds
> > > > the
> > > > > > > saved
> > > > > > > > > > object's objectid to lsavedobjectids. That is also a good
> > way
> > > > to tell
> > > > > > > if
> > > > > > > > > > there were validation issues with the object - if there
> > were
> > > > the
> > > > > > > object
> > > > > > > > > > won't be saved and no objectid will be added to the list.
>
> > > > > > > > > > Blair
>
> > > > > > > > > > On Mon, Dec 1, 2008 at 11:18 AM, Marco van den Oever <
>
> > > > > > > > > > [EMAIL PROTECTED]> wrote:
>
> > > > > > > > > > > Ok for the ones interested, as in this case every answer
> > is a
> > > > new
> > > > > > > > > > > answer you just have to generate a new uuid value to set
> > the
> > > > > > > objectid
> > > > > > > > > > > of the object:
>
> > > > > > > > > > > <!--- if data exists show answer field --->
>
> > > > > > > > > > > <cfif len(stobj.department)>
>
> > > > > > > > > > > <cfset application.tai = CreateUUID()>
>
> > > > > > > > > > > <ft:object typename="ticketanswers"
> > > > objectid="#application.tai#"
> > > > > > > > > > > lFields="answer" r_stPrefix="prefix" legend="Answer" />
>
> > > > > > > > > > > </cfif>
>
> > > > > > > > > > > Then in the processform reformat the uuid so it matches
> > the
> > > > format
> > > > > > > > > > > used in the form names:
>
> > > > > > > > > > > <!--- if a answer was entered set to db --->
>
> > > > > > > > > > > <cfif isdefined('application.tai')>
>
> > > > > > > > > > > <cfset application.tai =
> > > > replace(application.tai,'-','','ALL') />
>
> > > > > > > > > > > </cfif>
>
> > > > > > > > > > > Then if the answer field was filled in, process the value
> > in
> > > > the
> > > > > > > db:
>
> > > > > > > > > > > <cfif form[application.tai & 'answer'] gt 0>
>
> > > > > > > > > > > <ft:processformobjects typename="ticketanswers">
>
> > > > > > > > > > > <cfset stProperties.answer = form[application.tai &
> > 'answer']
> > > > />
> > > > > > > > > > > <cfset stProperties.ticketobjectid = stobj.objectid />
>
> > > > > > > > > > > </ft:processformobjects>
>
> > > > > > > > > > > </cfif>
>
> > > > > > > > > > > Cheers
>
> > > > > > > > > > > On Nov 30, 11:20 pm, Marco van den Oever <
> > > > > > > [EMAIL PROTECTED]>
> > > > > > > > > > > wrote:
> > > > > > > > > > > > I want to check if the answer form field "answer" was
> > > > filled in,
> > > > > > > > > > > > therefore i have to check on the form field name.
>
> > > > > > > > > > > > The form field names have a uuid assigned to their name
> > > > which is
> > > > > > > > > > > > simply the objectid, but when you add a additional
> > object
> > > > then
> > > > > > > the
> > > > > > > > > > > > form fields of that object all get a new uuid value
> > > > assigned to
> > > > > > > them.
>
> > > > > > > > > > > > How can i grab that new uuid value so i also can use it
> > in
> > > > a cfif
> > > > > > > > > > > > statement i use?
>
> > > > > > > > > > > > Below you see a form dump, the fieldnames of the object
> > > > tickets
> > > > > > > have
> > > > > > > > > > > > all :EE93D033FB0828DD12E6AB8742653DDF
> > > > > > > > > > > > The fieldnames of the object ticketanswers have all:
> > > > > > > > > > > > EF696EF7B53EF4D0EA063AC9479E2A75
>
> > > > > > > > > > > > EE93D033FB0828DD12E6AB8742653DDFDEPARTMENT
> > > > > > > EE7B4D0D-041E-80D9-
> > > > > > > > > > > > CE7F039BB168EBD0
> > > > > > > > > > > > EE93D033FB0828DD12E6AB8742653DDFDESCRIPTION This
> > > > happens
> > > > > > > when:
> > > > > > > > > > > > EE93D033FB0828DD12E6AB8742653DDFDESCRIPTIONINCLUDE
> > 1
> > > > > > > > > > > > EE93D033FB0828DD12E6AB8742653DDFERRORURL [empty
> > > > string]
> > > > > > > > > > > > EE93D033FB0828DD12E6AB8742653DDFNOTIFICATION online
> > > > > > > > > > > > EE93D033FB0828DD12E6AB8742653DDFOBJECTID
> > EE93D033-
> > > > > > > > > > > > FB08-28DD-12E6AB8742653DDF
> > > > > > > > > > > > EE93D033FB0828DD12E6AB8742653DDFPRIORITY medium
> > > > > > > > > > > > EE93D033FB0828DD12E6AB8742653DDFSUBJECT Problem
> > > > with:
> > > > > > > > > > > > EE93D033FB0828DD12E6AB8742653DDFTYPENAME tickets
> > > > > > > > > > > > EF696EF7B53EF4D0EA063AC9479E2A75ANSWER [empty string]
> > > > > > > > > > > > EF696EF7B53EF4D0EA063AC9479E2A75ANSWERINCLUDE 1
> > > > > > > > > > > > EF696EF7B53EF4D0EA063AC9479E2A75OBJECTID
> > > > > > > EF696EF7-B53E-F4D0-
> > > > > > > > > > > > EA063AC9479E2A75
> > > > > > > > > > > > EF696EF7B53EF4D0EA063AC9479E2A75TYPENAME
> > > > ticketanswers
>
> > > > > > > > > > > > On Nov 30, 9:25 pm, Marco van
>
> ...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"farcry-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/farcry-dev?hl=en
-~----------~----~----~----~------~----~------~--~---