A customer has asked for the addition of a "Copy" button for dynamic
objects and Geoff suggested doing a getData() followed by createData().
The following code on two boxes (specs below) is successfully creating
records in the "refobjects" and "fqaudit" tables, but failing to insert
a record into "dmEvent".

<cfscript>
oType = createobject("component",
application.types["dmEvent"].typePath);
stProps = oType.getData(some_valid_dmEvent_objectid);
stProps.objectid = createUuid();

oType.createData(stProperties=stProps);
</cfscript>

If the cfdump in createData()'s catch block is uncommented, the output
is "unknown type". If all the datetime values are overwritten to now(),
like this:

<cfscript>
oType = createobject("component",
application.types["dmEvent"].typePath);
stProps = oType.getData(some_valid_dmEvent_objectid);
stProps.objectid = createUuid();

stProps.datetimelastupdated = now();
stProps.datetimecreated = now();
stProps.publishDate = now();
stProps.expiryDate = now();
stProps.startDate = now();
stProps.endDate = now();

oType.createData(stProperties=stProps);
</cfscript>

the "dmEvent" record is inserted.

Could there be some incompatibility between the datetime format that
ColdFusion is supplying and the format that MySQL is happy to accept?
Perhaps it's a precision issue?

And I can't help wondering is how oType.createData() works for dmEvents
via FarCry if running this CFML directly is failing.

Any ideas? Thanks!



Development server: Win2K Server, MySQL 4.0.18-max-debug, FarCry FarCry:
b210, FourQ: b120
Development workstation: WinXP, MySQL 4.0.20a-debug, FarCry: unknown,
FourQ: b122


-- 
Aidan Whitehall   [EMAIL PROTECTED]
Macromedia ColdFusion Developer
Fairbanks Environmental   +44 (0)1695 51775

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

---
You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to