I am trying to create a transaction, but the NewTransaction method fails when I run it.
Is there something I am missing to get the new transaction function to work?
ILedgersManager ledgersManager = sps.GetService<ILedgersManager>();
ILedgerInfo ledgerInfo = ledgersManager.Ledgers.Where(i => i.Name == textBox2.Text).Single();
ITransactionsManager txMgr = sps.GetService<ITransactionsManager>();
ITransaction tx = txMgr.NewTransaction<ITransaction>(ledgerInfo);
The exception that is thrown says "Operation is not valid due to the state of the current object"
Error trying to create a new transaction
-
- Posts: 18
- Joined: Tue Jan 29, 2013 12:06 pm
Re: Error trying to create a new transaction
Brain,
Please use a specific Transaction type for the type argument.
ITransactionsManager txMgr = sps.GetService<ITransactionsManager>();
ITransaction tx = txMgr.NewTransaction<IReceiptTransaction>(ledgerInfo);
Please use a specific Transaction type for the type argument.
ITransactionsManager txMgr = sps.GetService<ITransactionsManager>();
ITransaction tx = txMgr.NewTransaction<IReceiptTransaction>(ledgerInfo);
-
- Posts: 18
- Joined: Tue Jan 29, 2013 12:06 pm
Re: Error trying to create a new transaction
Thanks. Now the issue I am having is trying to set the Payor/Payee of the transactions. I do not see a property for Payor in the transaction object, nor do I see a Get/Set Property method.
Is there some sort of extended properties object that I need to call?
Is there some sort of extended properties object that I need to call?
-
- Posts: 18
- Joined: Tue Jan 29, 2013 12:06 pm
Re: Error trying to create a new transaction
Disregard. I see that the Name property is associated to the payor.