You have 'creatorsystemid' set as both a property and a relationship.

Mark

On Thu, Dec 4, 2008 at 7:21 AM, Chris Peterson <[EMAIL PROTECTED]> wrote:
> ya know, 'System' sounds kinda reserved wordish, I'm not sure, but try
> changing the name of that object and see what you get?
>
> On Wed, Dec 3, 2008 at 3:15 PM, Josh Nathanson <[EMAIL PROTECTED]>
> wrote:
>>
>> I'm back already!
>>
>> I realized I *do* want a onetomany relationship, with the system object as
>> the parent and the transactions as the children, because when I get a
>> system
>> object I'd like to see the transaction children as an array, and this was
>> not happening when using manytoone.
>>
>> So I went back to my original xml and tried to use
>> transaction.setParentSystem( parentsystemobject ), where
>> parentsystemobject
>> is a transfer object of class "system", as it explains in the docs, in the
>> Post/Comments example, but I'm back to the original error.
>>
>> Arg!
>>
>> -----Original Message-----
>> From: [email protected] [mailto:[EMAIL PROTECTED]
>> On Behalf Of JoshNathanson
>> Sent: Wednesday, December 03, 2008 11:45 AM
>> To: transfer-dev
>> Subject: [transfer-dev] Re: Transfer Noob: error "value returned from the
>> getParentsystem function is not of type transfer.com.TransferObject"
>>
>>
>> Thanks Chris.  Actually the issue was in trying to save a transaction
>> object rather than a system object.  I changed the relationship from a
>> onetomany on the system object to a manytoone on the transaction
>> object and it seems to be working fine now.  My xml now looks like
>> this:
>>
>> <object name="system" table="Systems">
>>        <id name="systemid" type="numeric" />
>>        <property name="systemname" type="string" />
>> </object>
>>
>> <object name="transaction" table="Transactions">
>>        <id name="transactionid" type="numeric" />
>>        <property name="transactiontimestamp" type="date" />
>>        <property name="transactiontype" type="string" />
>>        <property name="transactionpayload" type="string" />
>>        <manytoone name="systems">
>>                <link to="system" column="creatorsystemid" />
>>        </manytoone>
>> </object>
>>
>> Then the code to save in my function looks like this (variables.tf
>> points to transferfactory):
>>
>> var tx = variables.tf.get( "transaction", arguments.TransactionId );
>>
>> tx.setTransactionId( arguments.TransactionId );
>> tx.setTransactionType( arguments.TransactionType );
>> tx.setTransactionPayload( payload );
>> if ( structkeyexists(arguments, "CreatorSystemId" )) {
>>        tx.setSystems( variables.tf.get("system",
>> arguments.CreatorSystemId ) );
>> }
>> variables.tf.save( tx );
>>
>> I'm sure I'll be back with more questions!
>>
>>
>>
>>
>
>
>
> --
> Hey! I dont tell you how to tell me what to do, so dont tell me how to do
> what you tell me to do! ~ Bender (Futurama)
>
> >
>



-- 
E: [EMAIL PROTECTED]
W: www.compoundtheory.com

--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-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/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to