Ok, so in fact i could add just an extra stprops.typename = "dmNews" and setData would create refCategories values?
On Aug 5, 2:54 am, Blair McKenzie <[email protected]> wrote: > A couple of things: > - As long as the struct passed into stProperties has objectid and typename, > setData will handle the rest. > - FC6.1 makes it possible to do the fourq's on array tables (and most other > arbitrary schema's), but as Sean says, it's still easier to let FarCry > handle it. > > Blair > > On Wed, Aug 4, 2010 at 6:05 AM, Marco van den Oever < > > [email protected]> wrote: > > Awesome, thanks! > > > On Aug 3, 9:56 pm, Sean Coyne <[email protected]> wrote: > > > More or less. > > > > The application.fapi.getcontenttype("dmNews") call may not work on > > > your system (depending on your FarCry version) > > > > and you can skip > > > <cfset myObjectIdToAdd = dmimageobjectid /> > > > <cfset arrayAppend(stNewsItem.aObjectIds,myObjectIdToAdd) /> > > > > and just do > > > <cfset arrayAppend(stNewsItem.aObjectIds,dmimageobjectid) /> > > > > But yes, that is the way to add a related item to the parent record. > > > > FarCry and setData will handle the "seq" and "typename" parts for you. > > > > On Aug 3, 10:59 am, Marco van den Oever <[email protected]> > > > wrote: > > > > > So: > > > > > <cfquery datasource="aquariusage"> > > > > INSERT INTO dmnews_aobjectids(data, > > > > parentid, > > > > seq, > > > > typename) > > > > VALUES('#dmimageobjectid#', > > > > '#dmnewsobjectid#', > > > > 1, > > > > 'dmImage') > > > > </cfquery> > > > > > Becomes: > > > > > <cfset oNews = application.fapi.getcontenttype("dmNews") /> > > > > <cfset stNewsItem = oNews.getData(objectId = dmnewsobjectid) /> > > > > <cfset myObjectIdToAdd = dmimageobjectid /> > > > > > <cfset arrayAppend(stNewsItem.aObjectIds,myObjectIdToAdd) /> > > > > > <cfset oNews.setData(stNewsItem) /> > > > > > ??? > > > > > On Aug 3, 3:50 pm, Sean Coyne <[email protected]> wrote: > > > > > > The correct way would be to load the parent dmNews object then append > > > > > the records to the aObjectIDs array. > > > > > > <cfset oNews = application.fapi.getcontenttype("dmNews") /> > > > > > <cfset stNewsItem = oNews.getData(objectId = someObjectId) /> > > > > > <cfset myObjectIdToAdd = "SOME UUID" /> > > > > > > <cfset arrayAppend(stNewsItem.aObjectIds,myObjectIdToAdd) /> > > > > > > <cfset oNews.setData(stNewsItem) /> > > > > > > On Aug 2, 3:12 pm, Marco van den Oever <[email protected]> > > > > > wrote: > > > > > > > mmm maybe because it's not a type and just a table so use a > > query??? > > > > > > Thanks... > > > > > > > On Aug 2, 9:00 pm, Marco van den Oever <[email protected] > > > > > > > wrote: > > > > > > > > I try to use <cfset obj = > > > createObject('component',application.stcoapi.dmnews_aobjectids.typePath) / > > > > > > > > > to manually set some values. > > > > > > > > I get the message key [DMNEWS_AOBJECTIDS] doesn't exist in struct > > , > > > > > > > why are those tables not in that struct? > > > > > > > How should i add values manually to that table? > > > -- > > You received this message cos you are subscribed to "farcry-dev" Google > > group. > > To post, email: [email protected] > > To unsubscribe, email: > > [email protected]<farcry-dev%[email protected]> > > For more options:http://groups.google.com/group/farcry-dev > > -------------------------------- > > Follow us on Twitter:http://twitter.com/farcry -- You received this message cos you are subscribed to "farcry-dev" Google group. To post, email: [email protected] To unsubscribe, email: [email protected] For more options: http://groups.google.com/group/farcry-dev -------------------------------- Follow us on Twitter: http://twitter.com/farcry
